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. _______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
