mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Macro][Dependencies] Properly model macro dependencies in the scanner
Add function to handle all macro dependencies kinds in the scanner,
including taking care of the macro definitions in the module interface
for its client to use. The change involves:
* Encode the macro definition inside the binary module
* Resolve macro modules in the dependencies scanners, including those
declared inside the dependency modules.
* Propagate the macro defined from the direct dependencies to track
all the potentially available modules inside a module compilation.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "swift/AST/DiagnosticsSema.h"
|
||||
#include "swift/AST/ModuleDependencies.h"
|
||||
#include "swift/AST/ModuleLoader.h"
|
||||
#include "swift/AST/PluginLoader.h"
|
||||
#include "swift/AST/SourceFile.h"
|
||||
#include "swift/AST/TypeCheckRequests.h"
|
||||
#include "swift/Basic/Assertions.h"
|
||||
@@ -180,6 +181,10 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker(
|
||||
workerCompilerInvocation->getSymbolGraphOptions(),
|
||||
workerCompilerInvocation->getCASOptions(),
|
||||
ScanASTContext.SourceMgr, Diagnostics));
|
||||
auto loader = std::make_unique<PluginLoader>(
|
||||
*workerASTContext, /*DepTracker=*/nullptr,
|
||||
workerCompilerInvocation->getFrontendOptions().DisableSandbox);
|
||||
workerASTContext->setPluginLoader(std::move(loader));
|
||||
|
||||
// Configure the interface scanning AST delegate.
|
||||
auto ClangModuleCachePath = getModuleCachePathFromClang(
|
||||
|
||||
Reference in New Issue
Block a user