ROSE
0.9.6a
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
functionEvaluationOrderTraversal.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <rose.h>
4
5
struct
FunctionCallInheritedAttribute
6
{
9
SgNode
*
currentScope
;
10
12
SgStatement
*
lastStatement
;
13
15
enum
16
{
17
INSIDE_FOR_INIT
,
INSIDE_FOR_TEST
,
INSIDE_FOR_INCREMENT
,
INSIDE_WHILE_CONDITION
,
18
INSIDE_DO_WHILE_CONDITION
,
IN_SAFE_PLACE
,
INSIDE_CONDITIONAL_EXP_TRUE_ARM
,
INSIDE_CONDITIONAL_EXP_FALSE_ARM
,
INSIDE_SHORT_CIRCUIT_EXP_RHS
19
}
20
scopeStatus
;
21
23
FunctionCallInheritedAttribute
() :
currentScope
(NULL),
lastStatement
(NULL),
scopeStatus
(
IN_SAFE_PLACE
) { }
24
};
25
27
struct
FunctionCallInfo
28
{
30
SgFunctionCallExp
*
functionCall
;
31
34
SgStatement
*
tempVarDeclarationLocation
;
35
37
enum
InsertionMode
38
{
40
INSERT_BEFORE
,
42
APPEND_SCOPE
,
43
INVALID
44
};
45
47
InsertionMode
tempVarDeclarationInsertionMode
;
48
49
FunctionCallInfo
(
SgFunctionCallExp
*
function
) :
50
functionCall
(function),
51
tempVarDeclarationLocation
(NULL),
52
tempVarDeclarationInsertionMode
(
INVALID
) { }
53
};
54
55
58
59
class
FunctionEvaluationOrderTraversal
:
public
AstTopDownBottomUpProcessing
<FunctionCallInheritedAttribute, bool>
60
{
61
public
:
64
static
std::pair< std::vector<FunctionCallInfo>, std::vector<FunctionCallInfo> >
GetFunctionCalls
(
SgNode
* root);
65
67
FunctionCallInheritedAttribute
evaluateInheritedAttribute
(
SgNode
* astNode,
FunctionCallInheritedAttribute
parentAttribute);
68
70
bool
evaluateSynthesizedAttribute
(
SgNode
* astNode,
FunctionCallInheritedAttribute
parentAttribute,
SynthesizedAttributesList
);
71
73
virtual
bool
IsFunctionCallSideEffectFree
(
SgFunctionCallExp
* functionCall);
74
75
private
:
76
78
79
FunctionEvaluationOrderTraversal
() { }
80
82
std::vector<FunctionCallInfo>
normalizableFunctionCalls
;
84
std::vector<FunctionCallInfo>
nonNormalizableFunctionCalls
;
85
};
86
rose-edg4x
src
midend
programTransformation
extractFunctionArgumentsNormalization
functionEvaluationOrderTraversal.h
Generated on Mon May 5 2014 17:29:23 for ROSE by
1.8.4