[cfe-dev] Name lookup in ObjC methods
Ted Kremenek
kremenek at apple.com
Wed Apr 2 13:04:02 PDT 2008
On Apr 2, 2008, at 12:57 PM, Argiris Kirtzidis wrote:
> -Remove TranslationUnitDecl because otherwise, FunctionDecl would
> return
> TranslationUnitDecl as its context and ObjCMethodDecl would
> return NULL (by ContextDecl::getParent()); a bit inconsistent.
> The convention would be that a ContextDecl chain ends at NULL, instead
> of a TranslationUnitDecl.
One thing I like about having a TranslationUnitDecl is that it could
be used to replace the hack I came up with for the class
"TranslationUnit". TranslationUnitDecl could own all top-level decls
in a translation unit, and thus serve a dual purpose of being a
ContextDecl and providing a clear owner for all of the Decls. It thus
would unify book-keeping we need to do anyway and also provide some
semantic clarity in the ASTs.
More information about the cfe-dev
mailing list