Skip to content

FunctionEvaluationOrderTraversal

Traverses a given AST and finds all function calls in the order in which they're evaluated Also, for each function we find where to put declarations of temporary variables so that they're accessible at the function call

Synopsis

Declared in <src/midend/programTransformation/extractFunctionArgumentsNormalization/functionEvaluationOrderTraversal.h>

class FunctionEvaluationOrderTraversal
    : public AstTopDownBottomUpProcessing<FunctionCallInheritedAttribute, bool>

Base Classes

Name Description
AstTopDownBottomUpProcessing<FunctionCallInheritedAttribute, bool> Attribute evaluator for inherited and synthesized attributes.

Member Functions

Name Description
IsFunctionCallSideEffectFree
virtual bool IsFunctionCallSideEffectFree(SgFunctionCallExp* functionCall); [virtual]
Returns true if the function call has no side effects.
evaluateInheritedAttribute
virtual FunctionCallInheritedAttribute evaluateInheritedAttribute( SgNode* astNode, FunctionCallInheritedAttribute parentAttribute); [virtual]
Visits AST nodes in pre-order
evaluateSynthesizedAttribute
virtual bool evaluateSynthesizedAttribute( SgNode* astNode, FunctionCallInheritedAttribute parentAttribute, SynthesizedAttributesList); [virtual]
Visits AST nodes in post-order. This is function-evaluation order.

Static Member Functions

Name Description
GetFunctionCalls
static std::pair<std::vector<FunctionCallInfo>, std::vector<FunctionCallInfo>> GetFunctionCalls(SgNode* root);
Traverses the subtree of the given AST node and finds all function calls in function-evaluation order.

Private Member Functions

Name Description
FunctionEvaluationOrderTraversal
FunctionEvaluationOrderTraversal(); [constructor]
Private constructor. Use the static method to access the functionality of this class.

Private Data Members

Name Description
nonNormalizableFunctionCalls All the function calls seen so far that can't be normalized.
normalizableFunctionCalls All the function calls seen so far that can be normalized.

Created with MrDocs