Re: [cfe-users] How to get code for a function template specialization

2019-08-07 Thread Romulo via cfe-users
Thanks, this solved my problem! On Sun, Aug 4, 2019 at 11:07 PM Richard Smith wrote: > On Fri, 2 Aug 2019 at 15:05, Romulo via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hello there, thanks for your time reading this :) >> >> I am trying to extract the code for a specialized template fu

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-07 Thread Ayush Mittal via cfe-users
Sure, Not a problem. What's the way to get the declarations such as *ptr and &bar as it is inside the *DeclRefExpr *block*. * *Example: * void foo(){ int bar=1; int **ptr; **ptr = &bar;* // this line } *If I query like this way:* if (const ValueDecl *VD = dyn_cast(DRE->getDecl())){ O

Re: [cfe-users] AST Recursive Visitor- Statements (Stmt *)

2019-08-07 Thread Richard Trieu via cfe-users
The declarations are "ptr" and "bar". "*ptr" and "&bar" are expressions since * and & are C++ operators. If you want the type of "*ptr" or "&bar", then you need to get the associated UnaryOperator (a sub-class of Expr) and call getType() on it. On Wed, Aug 7, 2019 at 2:28 PM Ayush Mittal wrote: