[cfe-dev] [PATCH] : Proper name lookup for namespaces
Argiris Kirtzidis
akyrtzi at gmail.com
Fri May 9 16:48:53 PDT 2008
>>
>> The attached patch contains changes to support proper name lookup for
>> namespaces.
>> It is mostly an overhaul of the IdentifierResolver:
>>
>> -It exposes an iterator interface to get all decls through the scope
>> chain:
>> for (IdentifierResolver::iterator
>> I = IdResolver.begin(II, CurContext), E = IdResolver.end(II); I
>> != E; ++I)
>> if ((*I)->getIdentifierNamespace() & NS)
>> return *I;
>>
>> -The semantic staff (checking IdentifierNamespace and Doug's checking
>> for shadowed tags were moved out of IdentifierResolver and back into
>> Sema. IdentifierResolver just gives an iterator for iterating over
>> all reachable decls of an identifier.
>>
>> -Fixes bug: http://llvm.org/bugs/show_bug.cgi?id=2275
>
> Looks great to me, thanks Argiris!
Applied here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080505/005668.html
with only a couple of changes:
-IdentifierResolver::AddShadowedDecl is passed a decl instead of an
ctx_iterator
-Moved Sema::isDeclInScope to IdentifierResolver::isDeclInScope, so that
it can use LookupContext class to check whether the decl belongs to the
decl context (LookupContext, when encountering a EnumConstantDecl, uses
the decl context that the EnumConstantDecl's EnumDecl belongs to).
-Argiris
More information about the cfe-dev
mailing list