Hi,<br><br>I propose to rename IdentifierResolver::IdDeclInfo::FindContext() to IdentifierResolver::IdDeclInfo::FindDeclVisibleInContext(), because it actually returns a Decl, but not a Context<br><br>Index: lib/Sema/IdentifierResolver.cpp <br>
=================================================================== <br>--- lib/Sema/IdentifierResolver.cpp (revision 60534) <br>
+++ lib/Sema/IdentifierResolver.cpp (working copy) <br>@@ -90,7 +90,8 @@ <br>
/// in the given context or in a parent of it. The search is in reverse <br> /// order, from end to begin. <br>
IdentifierResolver::IdDeclInfo::DeclsTy::iterator <br>-IdentifierResolver::IdDeclInfo::FindContext(const LookupContext &Ctx, <br>
+IdentifierResolver::IdDeclInfo::FindDeclVisibleInContext( <br>+ const LookupContext &Ctx, <br>
const DeclsTy::iterator &Start) { <br> for (DeclsTy::iterator I = Start; I != Decls.begin(); --I) { <br>
if (Ctx.isEqOrContainedBy(LookupContext(*(I-1)))) <br>@@ -267,7 +268,7 @@ <br>
<br> IdDeclInfo::DeclsTy::iterator I; <br>
if (LookInParentCtx) <br>- I = IDI->FindContext(LC); <br>
+ I = IDI->FindDeclVisibleInContext(LC); <br> else { <br>
for (I = IDI->decls_end(); I != IDI->decls_begin(); --I) <br> if (LookupContext(*(I-1)) == LC) <br>
@@ -290,7 +291,7 @@ <br><br> BaseIter I = getIterator();<br> if (LookInParentCtx())<br>- I = Info->FindContext(Ctx, I);<br>
+ I = Info->FindDeclVisibleInContext(Ctx, I);<br> else {<br> if (I != Info->decls_begin() && LookupContext(*(I-1)) != Ctx) {<br> // The next decl is in different declaration context.<br>Index: lib/Sema/IdentifierResolver.h<br>
===================================================================<br>--- lib/Sema/IdentifierResolver.h (revision 60534)<br>+++ lib/Sema/IdentifierResolver.h (working copy)<br>@@ -94,18 +94,18 @@<br> /// FindContext - Returns an iterator pointing just after the decl that is<br>
/// in the given context or in a parent of it. The search is in reverse<br> /// order, from end to begin.<br>- DeclsTy::iterator FindContext(const LookupContext &Ctx) {<br>- return FindContext(Ctx, Decls.end());<br>
+ DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx) {<br>+ return FindDeclVisibleInContext(Ctx, Decls.end());<br> }<br><br> /// FindContext - Returns an iterator pointing just after the decl that is<br>
/// in the given context or in a parent of it. The search is in reverse<br> /// order, from end to begin.<br>- DeclsTy::iterator FindContext(const LookupContext &Ctx,<br>+ DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx,<br>
const DeclsTy::iterator &Start);<br><br> void AddDecl(NamedDecl *D) {<br>- Decls.insert(FindContext(LookupContext(D)), D);<br>+ Decls.insert(FindDeclVisibleInContext(LookupContext(D)), D);<br>
}<br><br> /// AddShadowed - Add a decl by putting it directly above the 'Shadow' decl.<br><br>