[Macros] Track macro dependency separately in module trace

Macro plugins are not normal Swift modules, track them differently.
Add "swiftmacros" field to the JSON file.

rdar://118013482
This commit is contained in:
Rintaro Ishizaki
2024-01-17 16:54:57 -08:00
parent 728d6809e9
commit a61ed80813
14 changed files with 191 additions and 59 deletions

View File

@@ -110,6 +110,9 @@ bool ExplicitModuleInterfaceBuilder::collectDepsForSerialization(
auto IncDeps =
Instance.getDependencyTracker()->getIncrementalDependencyPaths();
InitialDepNames.append(IncDeps.begin(), IncDeps.end());
auto MacroDeps =
Instance.getDependencyTracker()->getMacroPluginDependencyPaths();
InitialDepNames.append(MacroDeps.begin(), MacroDeps.end());
InitialDepNames.push_back(interfacePath.str());
for (const auto &extra : extraDependencies) {
InitialDepNames.push_back(extra.str());