[cfe-dev] Cleaning up the representation of Decls in the AST
kremenek at apple.com
Mon Aug 25 09:51:47 PDT 2008
On Aug 23, 2008, at 5:57 PM, Neil Booth wrote:
> Sorry I should have been clearer. I'm not referring to visibility,
> I'm referring to the fact that in C "struct y" is at file scope,
> whereas in C++ it's a nested struct.
>>> How would one walk file-scope struct/
>>> union/enum declarations for C?
>> We can currently iterate over all file-scope declarations using
>> TranslationUnit (which contains references to all top-level
>> declarations). This same interface could be preserved by (a)
>> providing a
>> new iterator mechanism to iterate over top-level DeclGroups and (b)
>> layering a revised iterator mechanism for iterating over the top-
>> Decls over the iterating mechanism for top-level DeclGroups.
> Hence my follow-up question - it seems your iterator would miss
> "struct y" in a C source file?
I'm still a little unclear about your point, but I believe you are
referring to the name lookup/Sema rules. The way I would look at it
is that our AST representation is somewhat orthogonal to handling the
name lookup rules in Sema.
More information about the cfe-dev