[cfe-dev] How to get type of variable (whether it is int, float ... static .. const .. )

Tom Care tcare at apple.com
Tue Aug 17 15:54:53 PDT 2010


From the VarDecl you can get the QualType, which has the information you need. Using the -cc1 parameter -ast-dump can be useful here too, to see what the layout is in the AST.

On Aug 17, 2010, at 3:30 PM, manavender reddy wrote:

> Hi all,
> 
> How can i get the type of variable for eg. const int x = 1;
> How can i get information that x is const and int. I have pointer to DeclStmt, from that i can get VarDecl. I am stuck after that.
> 
> Thanks
> Manavender
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100817/64c2696f/attachment.html>


More information about the cfe-dev mailing list