16 #ifndef __CPUI_CALLGRAPH__
17 #define __CPUI_CALLGRAPH__
43 bool isCycle(
void)
const {
return ((flags&1)!=0); }
44 void saveXml(ostream &s)
const;
45 const Address &getCallSiteAddr(
void)
const {
return callsiteaddr; }
62 vector<CallGraphEdge> inedge;
63 vector<CallGraphEdge> outedge;
68 void clearMark(
void)
const { flags &= ~((uint4)mark); }
69 bool isMark(
void)
const {
return ((flags&mark)!=0); }
70 const Address getAddr(
void)
const {
return entryaddr; }
71 const string &getName(
void)
const {
return name; }
72 Funcdata *getFuncdata(
void)
const {
return fd; }
73 int4 numInEdge(
void)
const {
return inedge.size(); }
74 const CallGraphEdge &getInEdge(int4 i)
const {
return inedge[i]; }
75 CallGraphNode *getInNode(int4 i)
const {
return inedge[i].from; }
76 int4 numOutEdge(
void)
const {
return outedge.size(); }
77 const CallGraphEdge &getOutEdge(int4 i)
const {
return outedge[i]; }
78 CallGraphNode *getOutNode(int4 i)
const {
return outedge[i].to; }
80 void saveXml(ostream &s)
const;
93 map<Address,CallGraphNode> graph;
94 vector<CallGraphNode *> seeds;
95 bool findNoEntry(vector<CallGraphNode *> &seeds);
98 void clearMarks(
void);
99 void cycleStructure(
void);
103 void iterateScopesRecursive(
Scope *scope);
104 void iterateFunctionsAddrOrder(
Scope *scope);
115 map<Address,CallGraphNode>::iterator begin(
void) {
return graph.begin(); }
116 map<Address,CallGraphNode>::iterator end(
void) {
return graph.end(); }
117 void buildAllNodes(
void);
119 void saveXml(ostream &s)
const;
120 void restoreXml(
const Element *el);