[cfe-dev] abort calling getTypeSize

Peeter Joot peeter.joot at gmail.com
Mon Feb 25 10:32:34 PST 2013

On Mon, Feb 25, 2013 at 12:35 PM, Dmitri Gribenko <gribozavr at gmail.com>wrote:

> You might want to examine the layout of an instantiation instead.

Okay, that makes sense.  I can drive this from a CXXRecordDecl visitor,
something like:

bool VisitCXXRecordDecl( CXXRecordDecl * r )
   if ( r->isThisDeclarationADefinition() )
      for ( CXXRecordDecl::field_iterator b = r->field_begin(), e =
r->field_end() ;
            b != e ; ++b )
         const FieldDecl * a = *b ;

         myVisitFieldDecl( a ) ;

   return true ;

I found getInstantiatedFromMemberClass() in the docs, and it appears I can
use this to see if the template is an instantiation.  However I'm having
trouble figuring out how to tell if the CXXRecordDecl is a template or not
(since I want to visit the fields of all instantanted template class decls
and all the fields of the plain old non-template classes).

I don't see a isTemplateClass() or anything like that?  How would such a
check be done?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130225/1c64c3aa/attachment.html>

More information about the cfe-dev mailing list