Skip to content

SageInterface::rebindVariableReferencesAfterMove

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]]
void
rebindVariableReferencesAfterMove(SgNode* root);

Description

Rebind local variable references after an AST subtree has been moved to a different lexical scope.

This is an explicit transformation operation, not a frontend or post‐processing repair. Every reference must already have a real, typed declaration. If a moved local reference cannot be resolved in its new lexical context, the operation terminates with a hard error.

Parameters

Name

Description

root

This class represents the base class for all IR nodes within Sage III.

Created with MrDocs