aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-12-05 01:57:57 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-12-05 01:57:57 +0000
commitebed7971cf47d2fc83f262e7d99cacc3d8b5f163 (patch)
treebb0da1b31267e310003494d968ae0b31e2221962
parentde7394157c3f83af55053128178aa71bdb08101c (diff)
Rename: FindContext -> FindDeclVisibleInContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60574 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/IdentifierResolver.cpp7
-rw-r--r--lib/Sema/IdentifierResolver.h8
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index cf0342fe1b..5fb18f6cef 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -90,7 +90,8 @@ bool IdentifierResolver::LookupContext::isEqOrContainedBy(
/// in the given context or in a parent of it. The search is in reverse
/// order, from end to begin.
IdentifierResolver::IdDeclInfo::DeclsTy::iterator
-IdentifierResolver::IdDeclInfo::FindContext(const LookupContext &Ctx,
+IdentifierResolver::IdDeclInfo::FindDeclVisibleInContext(
+ const LookupContext &Ctx,
const DeclsTy::iterator &Start) {
for (DeclsTy::iterator I = Start; I != Decls.begin(); --I) {
if (Ctx.isEqOrContainedBy(LookupContext(*(I-1))))
@@ -267,7 +268,7 @@ IdentifierResolver::begin(DeclarationName Name, const DeclContext *Ctx,
IdDeclInfo::DeclsTy::iterator I;
if (LookInParentCtx)
- I = IDI->FindContext(LC);
+ I = IDI->FindDeclVisibleInContext(LC);
else {
for (I = IDI->decls_end(); I != IDI->decls_begin(); --I)
if (LookupContext(*(I-1)) == LC)
@@ -290,7 +291,7 @@ void IdentifierResolver::iterator::PreIncIter() {
BaseIter I = getIterator();
if (LookInParentCtx())
- I = Info->FindContext(Ctx, I);
+ I = Info->FindDeclVisibleInContext(Ctx, I);
else {
if (I != Info->decls_begin() && LookupContext(*(I-1)) != Ctx) {
// The next decl is in different declaration context.
diff --git a/lib/Sema/IdentifierResolver.h b/lib/Sema/IdentifierResolver.h
index 5a0f746776..9d78513395 100644
--- a/lib/Sema/IdentifierResolver.h
+++ b/lib/Sema/IdentifierResolver.h
@@ -94,18 +94,18 @@ class IdentifierResolver {
/// FindContext - Returns an iterator pointing just after the decl that is
/// in the given context or in a parent of it. The search is in reverse
/// order, from end to begin.
- DeclsTy::iterator FindContext(const LookupContext &Ctx) {
- return FindContext(Ctx, Decls.end());
+ DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx) {
+ return FindDeclVisibleInContext(Ctx, Decls.end());
}
/// FindContext - Returns an iterator pointing just after the decl that is
/// in the given context or in a parent of it. The search is in reverse
/// order, from end to begin.
- DeclsTy::iterator FindContext(const LookupContext &Ctx,
+ DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx,
const DeclsTy::iterator &Start);
void AddDecl(NamedDecl *D) {
- Decls.insert(FindContext(LookupContext(D)), D);
+ Decls.insert(FindDeclVisibleInContext(LookupContext(D)), D);
}
/// AddShadowed - Add a decl by putting it directly above the 'Shadow' decl.