[cfe-dev] How could I get sizeof from RecordDecl with clang?

Douglas Gregor dgregor at apple.com
Fri May 27 08:23:12 PDT 2011


On May 27, 2011, at 8:05 AM, Wenhan Gu wrote:

> Hi all,
> 
> I want to get sizeof, offsetof, alignment... of struct type using clang.
> I've already seek all RecordDecl and related inheritance class on doxygen but cannot find interfaces like getSizeOf().
> 
> Could someone give me a hand?

ASTContext::getTypeInfo().

ASTContext has many manipulation routines for AST nodes.

	- Doug




More information about the cfe-dev mailing list