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:
@@ -184,6 +184,9 @@ private:
|
||||
/// modules.
|
||||
std::vector<serialization::SearchPath> SearchPaths;
|
||||
|
||||
/// The external macro plugins from the macro definition inside the module.
|
||||
SmallVector<ExternalMacroPlugin, 4> MacroModuleNames;
|
||||
|
||||
/// Info for the (lone) imported header for this module.
|
||||
struct {
|
||||
off_t fileSize;
|
||||
@@ -634,6 +637,11 @@ public:
|
||||
return UserModuleVersion;
|
||||
}
|
||||
|
||||
/// Get external macro names.
|
||||
ArrayRef<ExternalMacroPlugin> getExternalMacros() const {
|
||||
return MacroModuleNames;
|
||||
}
|
||||
|
||||
/// If the module-defining `.swiftinterface` file is an SDK-relative path,
|
||||
/// resolve it to be absolute to the specified SDK.
|
||||
std::string resolveModuleDefiningFilePath(const StringRef SDKPath) const;
|
||||
|
||||
Reference in New Issue
Block a user