From fe8dc76f8059fb915abdc6af5a931c78bf790ced Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 7 Oct 2009 22:04:40 +0000 Subject: Dead code elimination. llvm-svn: 83492 --- clang/lib/Sema/SemaLookup.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'clang/lib/Sema/SemaLookup.cpp') diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index b55a5333e12..82a11b644e2 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/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); -- cgit v1.2.3