(no subject)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

manavender reddy
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
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: (no subject)

jahanian
In general this is what you should do.
1) Look what kind of AST clang generates. You can see it by: clang -
cc1 -ast-dump foo.c

2) Then look at the doxygen documentation: http://clang.llvm.org/doxygen

And find the related AST in the documentation and see if it has a  
member getType() defined
for it. It could be in the AST or one of its base classes.

- Fariborz



On Aug 17, 2010, at 3:24 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
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev