aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-07 09:11:48 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-07 09:11:48 +0000
commitf5c9f9fd6f5e2850b9b0f19283430245b696c6e5 (patch)
treeeaf11351dbbffd667d8f3cbf539cf784d629e925 /lib/Sema/SemaLookup.cpp
parent72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 (diff)
Switch NamespaceDecl from its own hand-rolled redeclaration chain over
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed redeclaration deserialization and merging logic provided by Redeclarable<T>. Otherwise, no functionality change. As a drive-by fix, collapse the "inline" bit into the low bit of the original namespace/anonymous namespace, saving 8 bytes per NamespaceDecl on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 984184b9c9..eab1517b65 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -2740,8 +2740,10 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result,
Result.getSema().ForceDeclarationOfImplicitMembers(Class);
// Enumerate all of the results in this context.
- for (DeclContext *CurCtx = Ctx->getPrimaryContext(); CurCtx;
- CurCtx = CurCtx->getNextContext()) {
+ llvm::SmallVector<DeclContext *, 2> Contexts;
+ Ctx->collectAllContexts(Contexts);
+ for (unsigned I = 0, N = Contexts.size(); I != N; ++I) {
+ DeclContext *CurCtx = Contexts[I];
for (DeclContext::decl_iterator D = CurCtx->decls_begin(),
DEnd = CurCtx->decls_end();
D != DEnd; ++D) {