[cfe-dev] How to get type of structure variable

Douglas Gregor dgregor at apple.com
Wed May 4 08:55:21 PDT 2011


On May 4, 2011, at 2:41 AM, Mohit Asudani wrote:

> Hi all,
> 
> 
> I want to output the structure type of certain variables in a program. 
> Should I go through programAST or CFG ? Which will be easier to get information from ?

The AST. Find the VarDecl, use ValueDecl::getType() to get its type, and then dissect that type with Type::getAs<RecordType>().

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110504/6b10f9ba/attachment.html>


More information about the cfe-dev mailing list