|
16 | 16 | #include "swift/AST/FileUnit.h" |
17 | 17 | #include "swift/AST/Module.h" |
18 | 18 | #include "swift/AST/ModuleLoader.h" |
| 19 | +#include "swift/AST/SearchPathOptions.h" |
19 | 20 | #include "llvm/Support/MemoryBuffer.h" |
20 | 21 | #include "llvm/Support/PrefixMapper.h" |
21 | 22 | #include "llvm/TargetParser/Triple.h" |
22 | 23 |
|
23 | 24 | namespace swift { |
24 | 25 | class ModuleFile; |
25 | 26 | class PathObfuscator; |
| 27 | +class ModuleFileSharedCore; |
26 | 28 | enum class ModuleLoadingBehavior; |
27 | 29 | namespace file_types { |
28 | 30 | enum ID : uint8_t; |
29 | 31 | } |
30 | 32 |
|
31 | | -/// Specifies how to load modules when both a module interface and serialized |
32 | | -/// AST are present, or whether to disallow one format or the other altogether. |
33 | | -enum class ModuleLoadingMode { |
34 | | - PreferInterface, |
35 | | - PreferSerialized, |
36 | | - OnlyInterface, |
37 | | - OnlySerialized |
38 | | -}; |
39 | | - |
40 | 33 | /// How a dependency should be loaded. |
41 | 34 | /// |
42 | 35 | /// \sa getTransitiveLoadingBehavior |
@@ -170,22 +163,18 @@ class SerializedModuleLoaderBase : public ModuleLoader { |
170 | 163 | } |
171 | 164 |
|
172 | 165 | /// Scan the given serialized module file to determine dependencies. |
173 | | - llvm::ErrorOr<ModuleDependencyInfo> scanModuleFile(Twine modulePath, bool isFramework); |
| 166 | + llvm::ErrorOr<ModuleDependencyInfo> |
| 167 | + scanModuleFile(Twine modulePath, bool isFramework, bool isTestableImport); |
174 | 168 |
|
175 | 169 | struct BinaryModuleImports { |
176 | 170 | llvm::StringSet<> moduleImports; |
177 | 171 | std::string headerImport; |
178 | 172 | }; |
179 | 173 |
|
180 | | - static llvm::ErrorOr<BinaryModuleImports> |
181 | | - getImportsOfModule(Twine modulePath, |
| 174 | + static BinaryModuleImports |
| 175 | + getImportsOfModule(const ModuleFileSharedCore &loadedModule, |
182 | 176 | ModuleLoadingBehavior transitiveBehavior, |
183 | | - bool isFramework, |
184 | | - bool isRequiredOSSAModules, |
185 | | - StringRef SDKName, |
186 | | - StringRef packageName, |
187 | | - llvm::vfs::FileSystem *fileSystem, |
188 | | - PathObfuscator &recoverer); |
| 177 | + StringRef packageName); |
189 | 178 |
|
190 | 179 | /// Load the module file into a buffer and also collect its module name. |
191 | 180 | static std::unique_ptr<llvm::MemoryBuffer> |
|
0 commit comments