aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-01-30 14:26:57 +0000
committerIain Sandoe <iain@sandoe.co.uk>2022-02-27 10:07:11 +0000
commit853ca5472314e109b98e46f0985f27f79e17d2bd (patch)
tree274591fa579fc06d80c4f1c5f2b56b87b6368b39 /clang/lib/Sema/SemaModule.cpp
parent2bbe6506d4a9fd847a8a613128beb2340af0137e (diff)
downloadllvm-853ca5472314e109b98e46f0985f27f79e17d2bd.zip
llvm-853ca5472314e109b98e46f0985f27f79e17d2bd.tar.gz
llvm-853ca5472314e109b98e46f0985f27f79e17d2bd.tar.bz2
[C++20][Modules][6/8] Record direct module imports.
This is a small cache to avoid having to check both Exports and Imports. Differential Revision: https://reviews.llvm.org/D118589
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 0606b3a4..a829693 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -514,6 +514,11 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
assert(ThisModule && "was expecting a module if building one");
}
+ // In some cases we need to know if an entity was present in a directly-
+ // imported module (as opposed to a transitive import). This avoids
+ // searching both Imports and Exports.
+ DirectModuleImports.insert(Mod);
+
return Import;
}