Referring to the code below, as I climb the Clang AST, when I arrive at the
DeclRefExpr refering to x on the lhs of the assignment x=2, how do I detect
that it is the block scope x, rather than the function scope x?
I need unique identifiers for the each x, so my symbolic execution
calculates the correct value for gx. Currently I am calling getDecl() and
then getQualifiedNameAsString(). I have tried calling getDeclContext, but
in references to both xs, I get a CXXMethod as the context.
Presumably I could use the value of the pointer returned by getDecl(), but
this doesn’t feel right.
Any help much appreciated.