diff options
author | John McCall <rjmccall@apple.com> | 2009-10-07 22:04:40 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-07 22:04:40 +0000 |
commit | 71fdaf4c5e33bed9b9133a5c3bbdbd930a702a6c (patch) | |
tree | 284c0efb25e3e65dd0dccd40da980b075bbebd2e /lib/Sema/SemaLookup.cpp | |
parent | 0351a1e2e17c1edf27f90c23fbf65d8fcad995c4 (diff) |
Dead code elimination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index b55a5333e1..82a11b644e 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -660,7 +660,6 @@ Sema::CppLookupName(Scope *S, DeclarationName Name, } Scope *Initial = S; - DeclContext *OutOfLineCtx = 0; IdentifierResolver::iterator I = IdResolver.begin(Name), IEnd = IdResolver.end(); @@ -742,26 +741,7 @@ Sema::CppLookupName(Scope *S, DeclarationName Name, // context as well as walking through the scopes. LookupResultsTy LookupResults; - assert((!OutOfLineCtx || OutOfLineCtx->isFileContext()) && - "We should have been looking only at file context here already."); bool LookedInCtx = false; - LookupResult Result; - while (OutOfLineCtx && - OutOfLineCtx != S->getEntity() && - OutOfLineCtx->isNamespace()) { - LookedInCtx = true; - - // Look into context considering using-directives. - CppNamespaceLookup(Context, OutOfLineCtx, Name, NameKind, IDNS, - LookupResults, &UDirs); - - if ((Result = MergeLookupResults(Context, LookupResults)) || - (RedeclarationOnly && !OutOfLineCtx->isTransparentContext())) - return std::make_pair(true, Result); - - OutOfLineCtx = OutOfLineCtx->getParent(); - } - for (; S; S = S->getParent()) { DeclContext *Ctx = static_cast<DeclContext *>(S->getEntity()); if (Ctx->isTransparentContext()) @@ -797,6 +777,7 @@ Sema::CppLookupName(Scope *S, DeclarationName Name, CppNamespaceLookup(Context, Ctx, Name, NameKind, IDNS, LookupResults, &UDirs); + LookupResult Result; if ((Result = MergeLookupResults(Context, LookupResults)) || (RedeclarationOnly && !Ctx->isTransparentContext())) return std::make_pair(true, Result); |