Skip to content

SageInterface::splitExpression

Replace an expression with a temporary variable and an assignment statement

Synopsis

Declared in <SageIII/sageInterface/sageInterface.h>

[[visibility]]
SgAssignInitializer*
splitExpression(
    SgExpression* from,
    std::string newName = "");

Description

Add a new temporary variable to contain the value of 'from'. Change reference to 'from' to use this new variable. Assumptions: (1)'from' is not within the test of a loop or 'if'; (2)not currently traversing 'from' or the statement it is in. Return value: the new temp variable declaration's assign initializer containing the from expression.

Return Value

This class represents the rhs of a variable declaration which includes an optional

Parameters

Name

Description

from

This class represents the notion of an expression. Expressions

Created with MrDocs