[cfe-dev] lookup from AST

Axel Naumann Axel.Naumann at cern.ch
Thu Oct 15 01:58:41 PDT 2009


Hi Doug,

thanks for your help!

Douglas Gregor wrote on 10/14/2009 05:07 PM:
> DeclContext::lookup will perform name lookup into a specific context 
> (class, namespace, etc.)

Should I create an IdentifierTable and put that single name (and its 
declaring contexts) that I want to look up in there? Or is there a 
simpler way of creating a DeclarationName from a string?

 > but it only looks in that context---it doesn't
 > perform full C++ qualified name lookup.
> The real name-lookup routines live in Sema, but there are multiple 
> clients that could benefit from moving these routines into the AST. For 
> qualified name lookup, it's "just" a bunch of refactoring. 

Qualified is all I need, so having those available outside of Sema would 
be nice. Should I give it a try and suggest a patch? If so, should I 
simply replace DeclContext::lookup by what Sema::LookupQualifiedName 
currently does? I believe given qualified lookup in DeclContext we 
wouldn't need DeclContext::lookup anymore.

Cheers, Axel.



More information about the cfe-dev mailing list