mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Cache underlying clang module during import resolution.
As recommended in feedback on https://github.com/apple/swift/pull/71302, cache the underlying clang module after loading it in `ImportResolver`, rather than filtering it out of the overall set of resolved imports. This is more efficient and results in less duplicated code that must identify the underlying clang module.
This commit is contained in:
@@ -406,6 +406,13 @@ public:
|
||||
/// resolution.
|
||||
void setImports(ArrayRef<AttributedImport<ImportedModule>> imports);
|
||||
|
||||
/// Set the imported underlying clang module for this source file. This gets
|
||||
/// called by import resolution.
|
||||
void setImportedUnderlyingModule(ModuleDecl *module) {
|
||||
assert(!ImportedUnderlyingModule && "underlying module already set");
|
||||
ImportedUnderlyingModule = module;
|
||||
}
|
||||
|
||||
/// Whether the given import has used @preconcurrency.
|
||||
bool hasImportUsedPreconcurrency(
|
||||
AttributedImport<ImportedModule> import) const;
|
||||
|
||||
Reference in New Issue
Block a user