ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FunctionEvaluationOrderTraversal Class Reference

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. More...

#include <functionEvaluationOrderTraversal.h>

Inheritance diagram for FunctionEvaluationOrderTraversal:
Collaboration diagram for FunctionEvaluationOrderTraversal:

Public Member Functions

FunctionCallInheritedAttribute evaluateInheritedAttribute (SgNode *astNode, FunctionCallInheritedAttribute parentAttribute)
 Visits AST nodes in pre-order. More...
 
bool evaluateSynthesizedAttribute (SgNode *astNode, FunctionCallInheritedAttribute parentAttribute, SynthesizedAttributesList)
 Visits AST nodes in post-order. More...
 
virtual bool IsFunctionCallSideEffectFree (SgFunctionCallExp *functionCall)
 Returns true if the function call has no side effects. More...
 
- Public Member Functions inherited from AstTopDownBottomUpProcessing< FunctionCallInheritedAttribute, bool >
bool traverse (SgNode *node, FunctionCallInheritedAttributeinheritedValue)
 evaluates attributes on the entire AST More...
 
bool traverseWithinFile (SgNode *node, FunctionCallInheritedAttributeinheritedValue)
 evaluates attributes only at nodes which represent the same file as where the evaluation was started More...
 
- Public Member Functions inherited from SgTreeTraversal< FunctionCallInheritedAttribute, bool >
bool traverse (SgNode *basenode, FunctionCallInheritedAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder)
 
bool traverseWithinFile (SgNode *basenode, FunctionCallInheritedAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder)
 
void traverseInputFiles (SgProject *projectNode, FunctionCallInheritedAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder)
 
virtual ~SgTreeTraversal ()
 
 SgTreeTraversal ()
 
 SgTreeTraversal (const SgTreeTraversal &)
 
const SgTreeTraversaloperator= (const SgTreeTraversal &)
 

Static Public Member Functions

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. More...
 

Private Member Functions

 FunctionEvaluationOrderTraversal ()
 Private constructor. Use the static method to access the functionality of this class. More...
 

Private Attributes

std::vector< FunctionCallInfonormalizableFunctionCalls
 All the function calls seen so far that can be normalized. More...
 
std::vector< FunctionCallInfononNormalizableFunctionCalls
 All the function calls seen so far that can't be normalized. More...
 

Additional Inherited Members

- Public Types inherited from AstTopDownBottomUpProcessing< FunctionCallInheritedAttribute, bool >
typedef SgTreeTraversal
< FunctionCallInheritedAttribute,
bool >
::SynthesizedAttributesList 
SynthesizedAttributesList
 
typedef SynthesizedAttributesList SubTreeSynthesizedAttributes
 
- Protected Types inherited from SgTreeTraversal< FunctionCallInheritedAttribute, bool >
typedef
AstSuccessorsSelectors::SuccessorsContainer 
SuccessorsContainer
 
typedef SuccessorsContainerSuccessorsContainerRef
 
- Protected Member Functions inherited from AstTopDownBottomUpProcessing< FunctionCallInheritedAttribute, bool >
virtual void atTraversalStart ()
 Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no-op. More...
 
virtual void atTraversalEnd ()
 

Detailed Description

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.

Definition at line 59 of file functionEvaluationOrderTraversal.h.

Constructor & Destructor Documentation

FunctionEvaluationOrderTraversal::FunctionEvaluationOrderTraversal ( )
inlineprivate

Private constructor. Use the static method to access the functionality of this class.

Definition at line 79 of file functionEvaluationOrderTraversal.h.

Member Function Documentation

static std::pair< std::vector<FunctionCallInfo>, std::vector<FunctionCallInfo> > FunctionEvaluationOrderTraversal::GetFunctionCalls ( SgNode root)
static

Traverses the subtree of the given AST node and finds all function calls in function-evaluation order.

FunctionCallInheritedAttribute FunctionEvaluationOrderTraversal::evaluateInheritedAttribute ( SgNode astNode,
FunctionCallInheritedAttribute  parentAttribute 
)
virtual
bool FunctionEvaluationOrderTraversal::evaluateSynthesizedAttribute ( SgNode astNode,
FunctionCallInheritedAttribute  parentAttribute,
SynthesizedAttributesList   
)
virtual

Visits AST nodes in post-order.

This is function-evaluation order.

Implements AstTopDownBottomUpProcessing< FunctionCallInheritedAttribute, bool >.

virtual bool FunctionEvaluationOrderTraversal::IsFunctionCallSideEffectFree ( SgFunctionCallExp functionCall)
virtual

Returns true if the function call has no side effects.

Member Data Documentation

std::vector<FunctionCallInfo> FunctionEvaluationOrderTraversal::normalizableFunctionCalls
private

All the function calls seen so far that can be normalized.

Definition at line 82 of file functionEvaluationOrderTraversal.h.

std::vector<FunctionCallInfo> FunctionEvaluationOrderTraversal::nonNormalizableFunctionCalls
private

All the function calls seen so far that can't be normalized.

Definition at line 84 of file functionEvaluationOrderTraversal.h.


The documentation for this class was generated from the following file: