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
sideEffect.h
Go to the documentation of this file.
1
#ifndef SIDEEFFEECT_H
2
#define SIDEEFFEECT_H
3
4
#include "
sage3.h
"
5
#include <list>
6
7
// DQ (12/30/2005): This is a Bad Bad thing to do (I can explain)
8
// it hides names in the global namespace and causes errors in
9
// otherwise valid and useful code. Where it is needed it should
10
// appear only in *.C files (and only ones not included for template
11
// instantiation reasons) else they effect user who use ROSE unexpectedly.
12
// using namespace std;
13
14
// Abstract base class interface to the side effect implementation.
15
// Implements the algorithm described in:
16
// Interprocedural side-effect analysis in linear time
17
// Cooper and Kennedy
18
// PLDI 1988
19
// Pass command line arguments (as passed to compiler front end)
20
// to calcSideEffect in order to calculate side effects across the
21
// whole program. Currently does not handle aliasing, though
22
// Cooper and Kennedy describe where to plug in an aliasing module.
23
// Also probably will not handle virtual method calls.
24
class
SideEffectAnalysis
{
25
26
public
:
27
29
static
SideEffectAnalysis
*
create
();
30
32
virtual
~SideEffectAnalysis
() = 0;
33
35
virtual
int
calcSideEffect
(
SgProject
&
project
) = 0;
36
#if 1
37
virtual
int
calcSideEffect
(
SgFile
& file) = 0;
39
41
virtual
int
calcSideEffect
(
SgNode
& node) = 0;
42
#endif
43
virtual
std::list<const char* >
getCalledFunctions
() = 0;
45
47
virtual
std::list<const char* >
getGMOD
(
const
char
* func) = 0;
48
50
virtual
std::list<const char* >
getDMOD
(
const
char
* stmt) = 0;
51
53
virtual
std::string
getNodeIdentifier
(
SgNode
*node) = 0;
54
55
protected
:
56
58
SideEffectAnalysis
();
60
SideEffectAnalysis
(
const
SideEffectAnalysis
& rhs);
61
62
private
:
64
SideEffectAnalysis
&
operator=
(
const
SideEffectAnalysis
& rhs);
65
66
};
67
69
std::string
getQualifiedFunctionName
(
SgFunctionCallExp
*astNode);
70
72
std::string
getQualifiedFunctionName
(
SgFunctionDeclaration
*astNode);
73
74
#endif
/* SIDEEFFECT_H */
rose-edg4x
src
midend
programAnalysis
sideEffectAnalysis
sideEffect.h
Generated on Mon May 5 2014 17:29:28 for ROSE by
1.8.4