ROSE 0.11.145.147
|
This normalization makes sure each function call argument is a side-effect free expression of only one variable.
To accomplish this, temporary variables are declared and the arguments of a function are evaluated before the function itself. Note: Normalization is not performed if it is unsafe. E,g.: while(Foo(Bar()) {} is not equal to t = Bar(); while(Foo(t) {} Note that only SgFunctionCall arguments are normalized. For example the arguments of the constructor initializer MyObject o(foo(), bar()) will not be extracted.
Definition at line 16 of file ExtractFunctionArguments.h.
#include <midend/programTransformation/extractFunctionArgumentsNormalization/ExtractFunctionArguments.h>
Public Member Functions | |
void | NormalizeTree (SgNode *tree, bool doUnsafeNormalization=false) |
Performs the function argument extraction on all function calls in the given subtree of the AST. | |
std::vector< SgVariableDeclaration * > | GetTemporariesIntroduced () |
bool | IsNormalized (SgNode *tree) |
bool | IsNormalizable (SgNode *tree) |
void ExtractFunctionArguments::NormalizeTree | ( | SgNode * | tree, |
bool | doUnsafeNormalization = false |
||
) |
Performs the function argument extraction on all function calls in the given subtree of the AST.
It does not do transofrmations in places where it is not safe. If you pass doUnsafeNormalization= true, we will normalize all call sites ignoring the safety (Suggested by Markus Schordan)