[cfe-dev] How to get global variables' SymbolRef?

edward jiamu edwardjiamu at gmail.com
Thu Nov 14 02:37:36 PST 2013


Thank you for your advice very much.

At last the problem is solved by this way:
1) record the "VarDecl* p" of global variable in the checkASTDecl
2) get the SymbolRef by recorded "VarDecl* p" in the evalCall
  SVal sv = state->getLValue(p, C.getLocationContext());
  const SymbolRef symRef = sv.getAsSymbol();

Do this to get the unique id of global variables and local variables.



--
View this message in context: http://clang-developers.42468.n3.nabble.com/How-to-get-global-variables-SymbolRef-tp4035939p4036071.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list