@@ -46,6 +46,8 @@ class SwiftModuleScanner : public SerializedModuleLoaderBase {
46
46
// / Clang-specific (-Xcc) command-line flags to include on
47
47
// / Swift module compilation commands
48
48
std::vector<std::string> swiftModuleClangCC1CommandLineArgs;
49
+ // / Module inputs specified with -swift-module-input
50
+ llvm::StringMap<std::string> explicitSwiftModuleInputs;
49
51
50
52
public:
51
53
std::optional<ModuleDependencyInfo> dependencies;
@@ -55,13 +57,15 @@ class SwiftModuleScanner : public SerializedModuleLoaderBase {
55
57
InterfaceSubContextDelegate &astDelegate,
56
58
StringRef moduleOutputPath, StringRef sdkModuleOutputPath,
57
59
std::vector<std::string> swiftModuleClangCC1CommandLineArgs,
60
+ llvm::StringMap<std::string> explicitSwiftModuleInputs,
58
61
ScannerKind kind = MDS_plain)
59
62
: SerializedModuleLoaderBase(ctx, nullptr , LoadMode,
60
63
/* IgnoreSwiftSourceInfoFile=*/ true ),
61
64
kind (kind), moduleName(moduleName), astDelegate(astDelegate),
62
65
moduleOutputPath(moduleOutputPath),
63
66
sdkModuleOutputPath(sdkModuleOutputPath),
64
- swiftModuleClangCC1CommandLineArgs(swiftModuleClangCC1CommandLineArgs) {}
67
+ swiftModuleClangCC1CommandLineArgs(swiftModuleClangCC1CommandLineArgs),
68
+ explicitSwiftModuleInputs(explicitSwiftModuleInputs) {}
65
69
66
70
std::error_code findModuleFilesInDirectory (
67
71
ImportPath::Element ModuleID, const SerializedModuleBaseName &BaseName,
@@ -73,6 +77,10 @@ class SwiftModuleScanner : public SerializedModuleLoaderBase {
73
77
bool SkipBuildingInterface, bool IsFramework,
74
78
bool IsTestableDependencyLookup) override ;
75
79
80
+ bool canImportModule (ImportPath::Module named, SourceLoc loc,
81
+ ModuleVersionInfo *versionInfo,
82
+ bool isTestableImport) override ;
83
+
76
84
virtual void collectVisibleTopLevelModuleNames (
77
85
SmallVectorImpl<Identifier> &names) const override {
78
86
llvm_unreachable (" Not used" );
@@ -105,7 +113,7 @@ class PlaceholderSwiftModuleScanner : public SwiftModuleScanner {
105
113
StringRef moduleOutputPath,
106
114
StringRef sdkModuleOutputPath)
107
115
: SwiftModuleScanner(ctx, LoadMode, moduleName, astDelegate,
108
- moduleOutputPath, sdkModuleOutputPath, {},
116
+ moduleOutputPath, sdkModuleOutputPath, {}, {},
109
117
MDS_placeholder) {
110
118
// FIXME: Find a better place for this map to live, to avoid
111
119
// doing the parsing on every module.
0 commit comments