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
ExtractFunctionArguments.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <rose.h>
4
#include "
functionEvaluationOrderTraversal.h
"
5
6
//class FunctionCallInfo;
7
13
class
ExtractFunctionArguments
14
{
15
public
:
16
19
void
NormalizeTree
(
SgNode
* tree,
bool
doUnsafeNormalization =
false
);
20
21
// returns a vector of newly introduced temporaries
22
std::vector<SgVariableDeclaration*>
GetTemporariesIntroduced
();
23
24
/*
25
IsNormalized: Given a subtree, returns true if every argument of every function call is a trivial arguemnt.
26
*/
27
bool
IsNormalized
(
SgNode
* tree);
28
29
/*
30
IsNormalizable: Given a subtree, returns true if every argument of every function call is a either trivial arguemnt or
31
is present in a SAFE place from where lifting is possible.
32
*/
33
bool
IsNormalizable
(
SgNode
* tree);
34
35
36
private
:
37
38
std::vector<SgVariableDeclaration*>
temporariesIntroduced
;
39
std::pair< std::vector<FunctionCallInfo>, std::vector<FunctionCallInfo> >
functionCalls
;
40
45
bool
FunctionArgumentNeedsNormalization
(
SgExpression
* argument);
46
49
bool
FunctionArgsNeedNormalization
(
SgExprListExp
* functionArgs);
50
53
bool
SubtreeNeedsNormalization
(
SgNode
* top);
54
57
void
RewriteFunctionCallArguments
(
const
FunctionCallInfo
& functionCallInfo);
58
61
void
InsertStatement
(
SgStatement
* newStatement,
SgStatement
* location,
const
FunctionCallInfo
& insertionMode);
62
63
bool
FunctionArgumentCanBeNormalized
(
SgExpression
* argument);
64
65
66
/* Given the expression which is the argument to a function call, returns true if that
67
expression is trivial. Trivial expressions are those which are simple variable references or constants.
68
*/
69
bool
IsFunctionArgumentTrivial
(
SgExpression
* argument);
70
71
/* Given a vector of function call sites returns true if every argument of every function call is a trivial expression
72
(IsFunctionArgumentTrivial). Such functions don't need to be normalized.
73
*/
74
bool
AreAllFunctionCallsTrivial
(std::vector<FunctionCallInfo> functions);
75
76
/* Given a vector of function call sites, returns true if every argument
77
at every function call site is either trivial (IsFunctionArgumentTrivial) or can be normalized (FunctionArgumentCanBeNormalized).
78
*/
79
bool
AreAllFunctionCallsNormalizable
(std::vector<FunctionCallInfo> functions);
80
};
rose-edg4x
src
midend
programTransformation
extractFunctionArgumentsNormalization
ExtractFunctionArguments.h
Generated on Mon May 5 2014 17:29:23 for ROSE by
1.8.4