mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "swift/AST/FileUnit.h"
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/ModuleDependencies.h"
|
||||
#include "swift/AST/ModuleLoader.h"
|
||||
#include "swift/AST/SearchPathOptions.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
@@ -191,6 +192,9 @@ protected:
|
||||
llvm::vfs::FileSystem *fileSystem,
|
||||
PathObfuscator &recoverer);
|
||||
|
||||
std::optional<MacroPluginDependency>
|
||||
resolveMacroPlugin(const ExternalMacroPlugin ¯o, StringRef packageName);
|
||||
|
||||
public:
|
||||
virtual ~SerializedModuleLoaderBase();
|
||||
SerializedModuleLoaderBase(const SerializedModuleLoaderBase &) = delete;
|
||||
@@ -514,6 +518,9 @@ public:
|
||||
getImportedModules(SmallVectorImpl<ImportedModule> &imports,
|
||||
ModuleDecl::ImportFilter filter) const override;
|
||||
|
||||
virtual void getExternalMacros(
|
||||
SmallVectorImpl<ExternalMacroPlugin> ¯os) const override;
|
||||
|
||||
virtual void
|
||||
collectLinkLibraries(ModuleDecl::LinkLibraryCallback callback) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user