SageInterface::fixVariableReferences
Mostly used internally when some AST pieces are built without knowing their target scope/parent, especially during bottomāup construction of AST. The associated symbols, parent and scope pointers cannot be set on construction then. A set of utility functions are provided to patch up scope, parent, symbol for them when the target scope/parent become know.
Synopsis
Declared in <SageIII/sageInterface/sageInterface.h>
[[visibility]]
int
fixVariableReferences(
SgNode* root,
bool cleanUnusedSymbol = true);
Description
Connect variable reference to the right variable symbols when feasible, return the number of references being fixed. In AST translation, it is possible to build a variable reference before the variable is being declared. buildVarRefExp() will use fake initialized name and symbol as placeholders to get the work done. Users should call fixVariableReference() when AST is complete and all variable declarations are in place.
Parameters
Name |
Description |
root |
This class represents the base class for all IR nodes within Sage III. |
Created with MrDocs