@@ -224,6 +224,9 @@ class ModuleDependencyInfoStorageBase {
224
224
// / command-line), no need to be saved to reconstruct from cache.
225
225
std::vector<std::string> auxiliaryFiles;
226
226
227
+ // / The macro dependencies.
228
+ std::map<std::string, MacroPluginDependency> macroDependencies;
229
+
227
230
// / The direct dependency of the module is resolved by scanner.
228
231
bool resolved;
229
232
// / ModuleDependencyInfo is finalized (with all transitive dependencies
@@ -253,9 +256,6 @@ struct CommonSwiftTextualModuleDependencyDetails {
253
256
// / (Clang) modules on which the bridging header depends.
254
257
std::vector<std::string> bridgingModuleDependencies;
255
258
256
- // / The macro dependencies.
257
- std::map<std::string, MacroPluginDependency> macroDependencies;
258
-
259
259
// / The Swift frontend invocation arguments to build the Swift module from the
260
260
// / interface.
261
261
std::vector<std::string> buildCommandLine;
@@ -326,12 +326,6 @@ class SwiftInterfaceModuleDependenciesStorage
326
326
void updateCommandLine (const std::vector<std::string> &newCommandLine) {
327
327
textualModuleDetails.buildCommandLine = newCommandLine;
328
328
}
329
-
330
- void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
331
- StringRef executablePath) {
332
- textualModuleDetails.macroDependencies .insert (
333
- {macroModuleName.str (), {libraryPath.str (), executablePath.str ()}});
334
- }
335
329
};
336
330
337
331
// / Describes the dependencies of a Swift module
@@ -382,12 +376,6 @@ class SwiftSourceModuleDependenciesStorage
382
376
void addTestableImport (ImportPath::Module module ) {
383
377
testableImports.insert (module .front ().Item .str ());
384
378
}
385
-
386
- void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
387
- StringRef executablePath) {
388
- textualModuleDetails.macroDependencies .insert (
389
- {macroModuleName.str (), {libraryPath.str (), executablePath.str ()}});
390
- }
391
379
};
392
380
393
381
// / Describes the dependencies of a pre-built Swift module (with no
@@ -786,6 +774,16 @@ class ModuleDependencyInfo {
786
774
storage->auxiliaryFiles .emplace_back (file);
787
775
}
788
776
777
+ void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
778
+ StringRef executablePath) {
779
+ storage->macroDependencies .insert (
780
+ {macroModuleName.str (), {libraryPath.str (), executablePath.str ()}});
781
+ }
782
+
783
+ std::map<std::string, MacroPluginDependency> &getMacroDependencies () const {
784
+ return storage->macroDependencies ;
785
+ }
786
+
789
787
void updateCASFileSystemRootID (const std::string &rootID) {
790
788
if (isSwiftInterfaceModule ())
791
789
cast<SwiftInterfaceModuleDependenciesStorage>(storage.get ())
@@ -809,13 +807,6 @@ class ModuleDependencyInfo {
809
807
// / For a Source dependency, register a `Testable` import
810
808
void addTestableImport (ImportPath::Module module );
811
809
812
- // / For a Source/Textual dependency, register a macro dependency.
813
- void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
814
- StringRef executablePath);
815
-
816
- // / For a Source/Textual dependency, if it Has macro dependency.
817
- bool hasMacroDependencies () const ;
818
-
819
810
// / Whether or not a queried module name is a `@Testable` import dependency
820
811
// / of this module. Can only return `true` for Swift source modules.
821
812
bool isTestableImport (StringRef moduleName) const ;
0 commit comments