On Mar 30, 2008, at 6:05 PM, Argiris Kirtzidis wrote:
> Chris Lattner wrote:
>> The second is more interesting for your namespace patch. I think
>> we really do need an AST-side concept of "scope", which is similar
>> to the parser one, but is also a bit different. This would allow
>> the implementation of ScopedDecl::isDefinedOutsideFunctionOrMethod
>> to correctly handle typedefs defined inside functions etc.
> Just a suggestion, how about a 'DeclContext' AST class that
> FunctionDecl would inherit from (and NamespaceDecl, RecordDecl):
>
> class FunctionDecl : public ValueDecl, public DeclContext {
> ....
>
> ScopedDecl would have a DeclContext member and
> isDefinedOutsideFunctionOrMethod would check if it's a FunctionDecl.
Yes, this is exactly what I was thinking (But ContextDecl instead of
DeclContext :).
With this change, we could then have a TranslationUnitDecl for the top-
level. It, ObjCMethod, and NamespaceDecl would also inherit from
DeclContext. What do you think?
-Chris
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev