summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-01-16 12:33:46 +0000
committerSam McCall <sam.mccall@gmail.com>2018-01-16 12:33:46 +0000
commit091b1efafb93a59ee0bb274e4ca012a673059b0b (patch)
tree5ea95514e5130375b070174c60f67f3a0659ac13 /clang/lib/Sema/SemaLookup.cpp
parent2c3849af22be0afbfefe9d096a2c51a5913d53a6 (diff)
downloadbcm5719-llvm-091b1efafb93a59ee0bb274e4ca012a673059b0b.tar.gz
bcm5719-llvm-091b1efafb93a59ee0bb274e4ca012a673059b0b.zip
Ensure code complete with !LoadExternal sees all local decls.
Summary: noload_lookups() was too lazy: in addition to avoiding external decls, it avoided populating the lazy lookup structure for internal decls. This is the right behavior for the existing callsite in ASTDumper, but I think it's not a very useful default, so we populate it by default. While here: - remove an unused test file accidentally added in r322371. - remove lookups_begin()/lookups_end() in favor of lookups().begin(), which is more common and more efficient. Reviewers: ilya-biryukov Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D42077 llvm-svn: 322548
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index c44a375d731..157d090490b 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -3543,7 +3543,8 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result,
// Enumerate all of the results in this context.
for (DeclContextLookupResult R :
- LoadExternal ? Ctx->lookups() : Ctx->noload_lookups()) {
+ LoadExternal ? Ctx->lookups()
+ : Ctx->noload_lookups(/*PreserveInternalState=*/false)) {
for (auto *D : R) {
if (auto *ND = Result.getAcceptableDecl(D)) {
Consumer.FoundDecl(ND, Visited.checkHidden(ND), Ctx, InBaseClass);
OpenPOWER on IntegriCloud