ROSE
0.11.96.11
rexompiler
src
frontend
SageIII
virtualCFG
interproceduralCFG.h
1
#ifndef INTERPROCEDURAL_CFG_H
2
#define INTERPROCEDURAL_CFG_H
3
4
#include "staticCFG.h"
5
#include "CallGraph.h"
6
#include <map>
7
#include <set>
8
#include <string>
9
10
11
class
SgIncidenceDirectedGraph
;
12
class
SgGraphNode
;
13
class
SgDirectedGraphEdge
;
14
15
16
namespace
StaticCFG
17
{
18
19
using
VirtualCFG::CFGNode
;
20
using
VirtualCFG::CFGEdge
;
21
22
23
class
ROSE_DLL_API
InterproceduralCFG
:
public
CFG
24
{
25
protected
:
26
virtual
void
buildCFG(
CFGNode
n,
27
std::map<CFGNode, SgGraphNode*>& all_nodes,
28
std::set<CFGNode>& explored,
29
ClassHierarchyWrapper
* classHierarchy);
30
public
:
31
InterproceduralCFG
() :
CFG
() {}
32
33
// The valid nodes are SgProject, SgStatement, SgExpression and SgInitializedName
34
InterproceduralCFG
(
SgNode
* node,
bool
is_filtered =
false
)
35
:
CFG
() {
36
graph_ = NULL;
37
is_filtered_ = is_filtered;
38
start_ = node;
39
buildCFG();
40
}
41
SgNode
* getEntry()
42
{
43
return
start_;
44
}
45
SgIncidenceDirectedGraph
* getGraph()
46
{
47
return
graph_;
48
}
49
SgGraphNode
* getGraphNode(
CFGNode
n) {
50
return
alNodes[n];
51
}
52
// Build CFG according to the 'is_filtered_' flag.
53
virtual
void
buildCFG
()
54
{
55
buildFullCFG();
56
}
57
std::map<CFGNode, SgGraphNode*> alNodes;
58
CFGNode
neededStart;
59
// Build CFG for debugging.
60
virtual
void
buildFullCFG();
61
// Build filtered CFG which only contains interesting nodes.
62
virtual
void
buildFilteredCFG();
63
};
64
65
}
// end of namespace StaticCFG
66
67
#endif
StaticCFG::InterproceduralCFG::buildCFG
virtual void buildCFG()
Build CFG according to the 'is_filtered_' flag.
Definition:
interproceduralCFG.h:53
SgDirectedGraphEdge
Definition:
Cxx_Grammar.h:37497
VirtualCFG::CFGNode
A node in the control flow graph.
Definition:
virtualCFG.h:70
SgNode
This class represents the base class for all IR nodes within Sage III.
Definition:
Cxx_Grammar.h:6739
StaticCFG::CFG
Definition:
staticCFG.h:24
ClassHierarchyWrapper
Definition:
ClassHierarchyGraph.h:8
VirtualCFG::CFGEdge
A control flow edge connecting two CFG nodes, with an edge condition to indicate edge types.
Definition:
virtualCFG.h:111
SgIncidenceDirectedGraph
Definition:
Cxx_Grammar.h:34205
StaticCFG::InterproceduralCFG
Definition:
interproceduralCFG.h:23
SgGraphNode
Definition:
Cxx_Grammar.h:36407
Generated on Mon Dec 19 2022 23:39:54 for ROSE by
1.8.17