@@ -224,6 +224,9 @@ class ModuleDependencyInfoStorageBase {
224224 // / command-line), no need to be saved to reconstruct from cache.
225225 std::vector<std::string> auxiliaryFiles;
226226
227+ // / The macro dependencies.
228+ std::map<std::string, MacroPluginDependency> macroDependencies;
229+
227230 // / The direct dependency of the module is resolved by scanner.
228231 bool resolved;
229232 // / ModuleDependencyInfo is finalized (with all transitive dependencies
@@ -253,9 +256,6 @@ struct CommonSwiftTextualModuleDependencyDetails {
253256 // / (Clang) modules on which the bridging header depends.
254257 std::vector<std::string> bridgingModuleDependencies;
255258
256- // / The macro dependencies.
257- std::map<std::string, MacroPluginDependency> macroDependencies;
258-
259259 // / The Swift frontend invocation arguments to build the Swift module from the
260260 // / interface.
261261 std::vector<std::string> buildCommandLine;
@@ -326,12 +326,6 @@ class SwiftInterfaceModuleDependenciesStorage
326326 void updateCommandLine (const std::vector<std::string> &newCommandLine) {
327327 textualModuleDetails.buildCommandLine = newCommandLine;
328328 }
329-
330- void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
331- StringRef executablePath) {
332- textualModuleDetails.macroDependencies .insert (
333- {macroModuleName.str (), {libraryPath.str (), executablePath.str ()}});
334- }
335329};
336330
337331// / Describes the dependencies of a Swift module
@@ -382,12 +376,6 @@ class SwiftSourceModuleDependenciesStorage
382376 void addTestableImport (ImportPath::Module module ) {
383377 testableImports.insert (module .front ().Item .str ());
384378 }
385-
386- void addMacroDependency (StringRef macroModuleName, StringRef libraryPath,
387- StringRef executablePath) {
388- textualModuleDetails.macroDependencies .insert (
389- {macroModuleName.str (), {libraryPath.str (), executablePath.str ()}});
390- }
391379};
392380
393381// / Describes the dependencies of a pre-built Swift module (with no
@@ -786,6 +774,16 @@ class ModuleDependencyInfo {
786774 storage->auxiliaryFiles .emplace_back (file);
787775 }
788776
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+
789787 void updateCASFileSystemRootID (const std::string &rootID) {
790788 if (isSwiftInterfaceModule ())
791789 cast<SwiftInterfaceModuleDependenciesStorage>(storage.get ())
@@ -809,13 +807,6 @@ class ModuleDependencyInfo {
809807 // / For a Source dependency, register a `Testable` import
810808 void addTestableImport (ImportPath::Module module );
811809
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-
819810 // / Whether or not a queried module name is a `@Testable` import dependency
820811 // / of this module. Can only return `true` for Swift source modules.
821812 bool isTestableImport (StringRef moduleName) const ;
0 commit comments