[cfe-dev] Source information for types

Eli Friedman eli.friedman at gmail.com
Wed Jul 8 15:53:47 PDT 2009


On Wed, Jul 8, 2009 at 1:28 PM, Argyrios Kyrtzidis<kyrtzidis at apple.com> wrote:
> I'd like to make a proposal for keeping source location information
> for types in the AST, to allow functionality like "find the source
> locations where this typedef is used".

I'm pretty sure you can do this already: you can recurse into a type
to find typedefs, getTypeSpecStartLoc returns the start of the
declaration specifiers, and you can re-lex the source and figure out
the precise location of the typedef name from there.  It might be nice
to provide utility methods to do this, but I don't see any need for
any core changes.

Also, your suggestion doesn't really address where exactly you plan to
store your flag; there aren't any spare bits in QualType.

-Eli



More information about the cfe-dev mailing list