summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-07 22:04:40 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-07 22:04:40 +0000
commitfe8dc76f8059fb915abdc6af5a931c78bf790ced (patch)
tree5eaa7af36b0404b91adc1d1ec82d1368c35083c5 /clang/lib/Sema/SemaLookup.cpp
parent55571bd7bd93df02c0f66743e09064fa13873ff9 (diff)
downloadbcm5719-llvm-fe8dc76f8059fb915abdc6af5a931c78bf790ced.tar.gz
bcm5719-llvm-fe8dc76f8059fb915abdc6af5a931c78bf790ced.zip
Dead code elimination.
llvm-svn: 83492
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp21
1 files changed, 1 insertions, 20 deletions
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<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);
OpenPOWER on IntegriCloud