mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Macros] Emit loaded module trace for plugins loaded from search paths
When loading plugins from `-plugin-path`, use the global `PluginRegistry` to keep a record of what's loaded. Emit these dependencies to the loaded module trace.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "swift/AST/DiagnosticEngine.h"
|
||||
#include "swift/AST/DiagnosticsFrontend.h"
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/PluginRegistry.h"
|
||||
#include "swift/Basic/FileTypes.h"
|
||||
#include "swift/Basic/JSONSerialization.h"
|
||||
#include "swift/Frontend/FrontendOptions.h"
|
||||
@@ -764,6 +765,11 @@ bool swift::emitLoadedModuleTraceIfNeeded(ModuleDecl *mainModule,
|
||||
std::make_pair(loadedDecl->getModuleFilename(), loadedDecl));
|
||||
}
|
||||
|
||||
// Add compiler plugin libraries as dependencies.
|
||||
auto *pluginRegistry = ctxt.getPluginRegistry();
|
||||
for (auto &pluginEntry : pluginRegistry->getLoadedLibraryPlugins())
|
||||
depTracker->addDependency(pluginEntry.getKey(), /*IsSystem*/ false);
|
||||
|
||||
std::vector<SwiftModuleTraceInfo> swiftModules;
|
||||
computeSwiftModuleTraceInfo(ctxt, abiDependencies, pathToModuleDecl,
|
||||
*depTracker, opts.PrebuiltModuleCachePath,
|
||||
|
||||
Reference in New Issue
Block a user