[cfe-dev] getting info about fields in a RecursiveASTVisitor::VisitFieldDecl override
peeter.joot at gmail.com
Fri Nov 30 16:09:22 PST 2012
I've answered part of my own question, by grepping the clang source tree
for ArrayTypeLoc, and found I can do something like:
TypeLoc TL = t->getTypeLoc() ;
// don't care if it's an array, just want the basic underlying type
of the array.
if ( const ArrayTypeLoc *Arr = dyn_cast<ArrayTypeLoc>(&TL) )
TL = Arr->getElementLoc() ;
Am guessing I can probably do something similar to see if the type is a
pointer or reference.
Is there any easy way to determine if the underlying type is one of the
fundamental types: char, short, int, long (not caring about
sign/const/volatile/... variations of these)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev