Chris Lattner wrote:
>> -Decl class has a ContextDecl member
>
> Should this be in Decl, or in ScopedDecl?  It doesn't make much sense 
> for struct fields (for example) to have this context pointer.
>
>> -All Decl subclasses receive a ContextDecl at their constructors
>
> Sounds good, but only scopedecl if possible.
Isn't this a bit restricting ? When NamespaceDecl is added, 
non-ScopedDecls could be under TranslationUnitDecl or a
specific NamespaceDecl. NamespaceDecl itself makes little sense to be a 
ScopedDecl, but it makes sense to give it
a context pointer to its enclosing namespace.
Most of the non-ScopedDecls are ObjC specific but for Objective C++ they 
will be able to use NamespaceDecl
context pointers to, for example, get their fully qualified name.

And if RecordDecl is made a ContextDecl (mostly useful for C++), a 
context pointer for FieldDecl would point at
the struct/class that defined it.

What do you think ?
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to