My ast node looks like this:
|-VarDecl 0x158f5190 <line:7:1, col:14> col:6 used ptr1 'int *' cinit
| |-UnaryOperator 0x158f62c0 <col:13, col:14> 'int *' prefix '&' cannot overflow
| | `-DeclRefExpr 0x158f62a0 col:14 'int' lvalue Var 0x158f50f0 'foo' 'int'
How can I get the address and name of 'foo' from VarDecl?
I have used DeclContext::decl_iterator to iterate through all the nodes and I can dump the entire VarDecl. I am interested in extracting information from DeclRefExpr with VarDecl.