0
votes

I am trying to interpret parts of the Clang AST you can see in the picture below. In short I am trying to do is to check if two variables are the same at different program points. After inspecting the AST, I noticed that the only commonality between the AST sections are the sections circled in blue.

Can anyone help me as to what these hex numbers correspond to in the AST? I understand that the first block corresponds to a Variable Declaration and the second block corresponds to a Expression. Are there methods on Stmt and Expr classes which can be invoked to get hold of these hex numbers?

enter image description here

1
Pointer addresses - Frank C.
@FrankC. Thanks for that, would it be possible to extract pointer addresses from Clang AST? - Varun
Accessing clang's AST documentation covers the API, you may want to go through that. - Frank C.

1 Answers

0
votes

Those are indeed raw pointer values.

You most likely need to check DeclRefExpr nodes and their corresponding declarations that they reference (i.e. getDecl method). Pointer to its declaration is the hex number you are looking for.

Happy hacking with Clang!