From: John McCall Date: Wed, 7 Oct 2009 22:04:40 +0000 (+0000) Subject: Dead code elimination. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71fdaf4c5e33bed9b9133a5c3bbdbd930a702a6c;p=clang Dead code elimination. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(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);