4 #ifndef ROSE_BinaryAnalysis_Dominance_H
5 #define ROSE_BinaryAnalysis_Dominance_H
7 #include <featureTests.h>
8 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
10 #include "BinaryControlFlow.h"
12 #include <boost/graph/depth_first_search.hpp>
13 #include <boost/graph/reverse_graph.hpp>
22 typedef boost::adjacency_list<boost::setS,
24 boost::bidirectionalS,
25 boost::property<boost::vertex_name_t, SgAsmBlock*>
28 template<
class ControlFlowGraph>
29 struct RelationMap:
public std::vector<typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor> {
33 void clear_ast(
SgNode *ast) ROSE_DEPRECATED(
"Use Sawyer::Container::Algorithm::graphDominators");
35 template<
class DominanceGraph>
36 void apply_to_ast(
const DominanceGraph &idg)
37 ROSE_DEPRECATED(
"Use Sawyer::Container::Algorithm::graphDominators");
39 template<
class ControlFlowGraph>
41 ROSE_DEPRECATED(
"Use Sawyer::Container::Algorithm::graphDominators");
43 template<
class DominanceGraph>
44 void cache_vertex_descriptors(
const DominanceGraph&)
45 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
48 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
51 template<class ControlFlowGraph>
53 build_idom_relation_from_cfg(const ControlFlowGraph &cfg,
54 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
55 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
57 template<class ControlFlowGraph>
58 void build_idom_relation_from_cfg(const ControlFlowGraph &cfg,
59 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
61 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
63 template<class ControlFlowGraph>
65 build_postdom_relation_from_cfg(const ControlFlowGraph &cfg,
66 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
67 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
69 template<class ControlFlowGraph>
71 build_postdom_relation_from_cfg(const ControlFlowGraph &cfg,
72 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
73 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop)
74 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
76 template<class ControlFlowGraph>
77 void build_postdom_relation_from_cfg(const ControlFlowGraph &cfg,
78 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
80 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
82 template<class ControlFlowGraph>
83 void build_postdom_relation_from_cfg(const ControlFlowGraph &cfg,
84 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
85 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop,
87 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
90 template<class DominanceGraph, class ControlFlowGraph>
91 DominanceGraph build_idom_graph_from_cfg(const ControlFlowGraph &cfg,
92 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
93 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
95 template<class ControlFlowGraph, class DominanceGraph>
96 void build_idom_graph_from_cfg(const ControlFlowGraph &cfg,
97 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
99 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
101 template<class DominanceGraph, class ControlFlowGraph>
102 DominanceGraph build_postdom_graph_from_cfg(const ControlFlowGraph &cfg,
103 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
104 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
106 template<class DominanceGraph, class ControlFlowGraph>
107 DominanceGraph build_postdom_graph_from_cfg(const ControlFlowGraph &cfg,
108 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
109 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop)
110 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
112 template<class ControlFlowGraph, class DominanceGraph>
113 void build_postdom_graph_from_cfg(const ControlFlowGraph &cfg,
114 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
116 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
118 template<class ControlFlowGraph, class DominanceGraph>
119 void build_postdom_graph_from_cfg(const ControlFlowGraph &cfg,
120 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
121 typename
boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop,
123 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
126 template<class DominanceGraph, class ControlFlowGraph>
127 DominanceGraph build_graph_from_relation(const ControlFlowGraph &cfg,
129 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
131 template<class ControlFlowGraph, class DominanceGraph>
132 void build_graph_from_relation(const ControlFlowGraph &cfg,
135 ROSE_DEPRECATED("Use
Sawyer::Container::Algorithm::graphDominators");
137 void set_debug(FILE *debug) { this->debug = debug; }
139 FILE *get_debug()
const {
return debug; }
149 template<
class DominanceGraph>
151 Dominance::apply_to_ast(
const DominanceGraph &idg)
154 fprintf(debug,
"Rose::BinaryAnalysis::Dominance::apply_to_ast:\n");
156 typename boost::graph_traits<DominanceGraph>::edge_iterator ei, ei_end;
157 for (boost::tie(ei, ei_end)=edges(idg); ei!=ei_end; ++ei) {
158 SgAsmBlock *dom_block =
get(boost::vertex_name, idg, source(*ei, idg));
159 SgAsmBlock *sub_block =
get(boost::vertex_name, idg, target(*ei, idg));
161 fprintf(debug,
" edge (d,s) = (%" PRIuPTR
",%" PRIuPTR
") = (0x%08" PRIx64
", 0x%08" PRIx64
")\n",
168 template<
class ControlFlowGraph>
170 Dominance::apply_to_ast(
const ControlFlowGraph &cfg,
171 const RelationMap<ControlFlowGraph> &idom)
173 typedef typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor CFG_Vertex;
175 assert(idom.size()<=num_vertices(cfg));
176 for (
size_t subordinate=0; subordinate<idom.size(); subordinate++) {
177 SgAsmBlock *sub_block =
get(boost::vertex_name, cfg, (CFG_Vertex)subordinate);
178 if (sub_block && idom[subordinate]!=boost::graph_traits<ControlFlowGraph>::null_vertex()) {
179 CFG_Vertex dominator = idom[subordinate];
180 SgAsmBlock *dom_block =
get(boost::vertex_name, cfg, dominator);
186 template<
class DominanceGraph>
188 Dominance::cache_vertex_descriptors(
const DominanceGraph &dg)
190 typename boost::graph_traits<DominanceGraph>::vertex_iterator vi, vi_end;
191 for (boost::tie(vi, vi_end)=vertices(dg); vi!=vi_end; ++vi) {
192 SgAsmBlock *block =
get(boost::vertex_name, dg, *vi);
203 template<
class ControlFlowGraph,
class DominanceGraph>
205 Dominance::build_idom_graph_from_cfg(
const ControlFlowGraph &cfg,
206 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
207 DominanceGraph &result)
209 RelationMap<ControlFlowGraph> idoms;
210 build_idom_relation_from_cfg(cfg, start, idoms);
211 build_graph_from_relation(cfg, idoms, result);
214 template<
class DominanceGraph,
class ControlFlowGraph>
216 Dominance::build_idom_graph_from_cfg(
const ControlFlowGraph &cfg,
217 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
220 build_idom_graph_from_cfg(cfg, start, dg);
224 template<
class ControlFlowGraph>
225 Dominance::RelationMap<ControlFlowGraph>
226 Dominance::build_idom_relation_from_cfg(
const ControlFlowGraph &cfg,
227 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
229 RelationMap<ControlFlowGraph> idom;
230 build_idom_relation_from_cfg(cfg, start, idom);
266 template<
class ControlFlowGraph>
268 Dominance::build_idom_relation_from_cfg(
const ControlFlowGraph &cfg,
269 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
270 RelationMap<ControlFlowGraph> &result)
272 typedef typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor CFG_Vertex;
274 struct debug_dom_set {
275 debug_dom_set(FILE *debug,
size_t vertex_i,
size_t idom_i,
276 const std::vector<size_t> &domsets,
const std::vector<CFG_Vertex> &flowlist) {
278 fprintf(debug,
"{ #%" PRIuPTR
"(%" PRIuPTR
")", vertex_i, flowlist[vertex_i]);
279 for (
size_t d=idom_i; d!=vertex_i; vertex_i=d, d=domsets[d])
280 fprintf(debug,
" #%" PRIuPTR
"(%" PRIuPTR
")", d, flowlist[d]);
281 fprintf(debug,
" }");
287 fprintf(debug,
"Rose::BinaryAnalysis::Dominance::build_idom_relation_from_cfg: starting at vertex %" PRIuPTR
"\n", start);
288 SgAsmBlock *block =
get(boost::vertex_name, cfg, start);
291 fprintf(debug,
" Vertex %" PRIuPTR
" is %s block of", start, func->
get_entry_block()==block?
"the entry":
"a");
293 fprintf(debug,
" an unnamed function");
295 fprintf(debug,
" function <%s>", func->
get_name().c_str());
297 fprintf(debug,
" at 0x%08" PRIx64
"\n", func->
get_entry_va());
302 std::vector<size_t> rflowlist;
303 std::vector<CFG_Vertex> flowlist = ControlFlow().flow_order(cfg, start, &rflowlist);
304 std::vector<size_t> idom(flowlist.size());
305 for (
size_t i=0; i<flowlist.size(); i++)
309 fprintf(debug,
" CFG:\n");
310 typename boost::graph_traits<ControlFlowGraph>::vertex_iterator vi, vi_end;
311 for (boost::tie(vi, vi_end)=vertices(cfg); vi!=vi_end; ++vi) {
312 SgAsmBlock *block =
get(boost::vertex_name, cfg, *vi);
313 fprintf(debug,
" %" PRIuPTR
" 0x%08" PRIx64
" --> {", (
size_t)(*vi), block?block->
get_address():0);
314 typename boost::graph_traits<ControlFlowGraph>::out_edge_iterator ei, ei_end;
315 for (boost::tie(ei, ei_end)=out_edges(*vi, cfg); ei!=ei_end; ++ei) {
316 fprintf(debug,
" %" PRIuPTR
"", (
size_t)target(*ei, cfg));
318 fprintf(debug,
" }\n");
321 fprintf(debug,
" Note: notation #M(N) means CFG vertex N at position M in the flow list.\n");
322 fprintf(debug,
" Flowlist: {");
323 for (
size_t i=0; i<flowlist.size(); i++) {
324 fprintf(debug,
" #%" PRIuPTR
"(%" PRIuPTR
")", i, (
size_t)flowlist[i]);
325 assert((
size_t)flowlist[i]<rflowlist.size());
326 assert(rflowlist[flowlist[i]]==i);
328 fprintf(debug,
" }\n");
336 fprintf(debug,
" Next pass through vertices...\n");
337 for (
size_t vertex_i=0; vertex_i<flowlist.size(); vertex_i++) {
338 CFG_Vertex vertex = flowlist[vertex_i];
340 fprintf(debug,
" vertex #%" PRIuPTR
"(%" PRIuPTR
")", (
size_t)vertex_i, (
size_t)vertex);
342 fprintf(debug,
" [skipping start vertex]\n");
344 fprintf(debug,
" dominators are ");
345 debug_dom_set(debug, vertex_i, idom[vertex_i], idom, flowlist);
346 fprintf(debug,
"\n");
351 typename boost::graph_traits<ControlFlowGraph>::in_edge_iterator pi, pi_end;
352 size_t new_idom = vertex_i;
353 for (boost::tie(pi, pi_end)=in_edges(vertex, cfg); pi!=pi_end; ++pi) {
354 CFG_Vertex predecessor = source(*pi, cfg);
355 assert(predecessor>=0 && predecessor<rflowlist.size());
356 size_t predecessor_i = rflowlist[predecessor];
358 fprintf(debug,
" pred #%zd(%" PRIuPTR
")", (
size_t)predecessor_i, (
size_t)predecessor);
362 if (predecessor!=vertex && predecessor_i!=boost::graph_traits<ControlFlowGraph>::null_vertex()) {
363 if (predecessor==start) {
364 new_idom = predecessor_i;
366 fprintf(debug,
"; new doms of #%" PRIuPTR
"(%" PRIuPTR
") are ", vertex_i, vertex);
367 debug_dom_set(debug, vertex_i, predecessor_i, idom, flowlist);
369 }
else if (idom[predecessor_i]!=predecessor_i) {
370 if (new_idom==vertex_i) {
371 new_idom = predecessor_i;
373 fprintf(debug,
"; new doms of #%" PRIuPTR
"(%" PRIuPTR
") are ", vertex_i, vertex);
374 debug_dom_set(debug, vertex_i, predecessor_i, idom, flowlist);
378 fprintf(debug,
"; new doms of #%" PRIuPTR
"(%" PRIuPTR
") are intersect(", vertex_i, vertex);
379 debug_dom_set(debug, vertex_i, new_idom, idom, flowlist);
380 fprintf(debug,
", ");
381 debug_dom_set(debug, vertex_i, predecessor_i, idom, flowlist);
383 size_t f1=new_idom, f2=predecessor_i;
392 fprintf(debug,
") = ");
393 debug_dom_set(debug, vertex_i, new_idom, idom, flowlist);
399 fprintf(debug,
"\n");
401 if (idom[vertex_i]!=new_idom) {
402 idom[vertex_i] = new_idom;
411 result.resize(num_vertices(cfg), boost::graph_traits<ControlFlowGraph>::null_vertex());
412 for (
size_t i=0; i<flowlist.size(); i++) {
414 result[flowlist[i]] = flowlist[idom[i]];
418 fprintf(debug,
" Final dom sets:\n");
419 for (
size_t vertex_i=0; vertex_i<flowlist.size(); vertex_i++) {
420 CFG_Vertex vertex = flowlist[vertex_i];
421 fprintf(debug,
" #%" PRIuPTR
"(%" PRIuPTR
") has dominators ", (
size_t)vertex_i, (
size_t)vertex);
422 debug_dom_set(debug, vertex_i, idom[vertex_i], idom, flowlist);
423 fprintf(debug,
"\n");
425 fprintf(debug,
" Final result:\n");
426 for (
size_t i=0; i<result.size(); i++) {
427 if (result[i]==boost::graph_traits<ControlFlow::Graph>::null_vertex()) {
428 fprintf(debug,
" CFG vertex %" PRIuPTR
" has no immediate dominator\n", i);
430 fprintf(debug,
" CFG vertex %" PRIuPTR
" has immediate dominator %" PRIuPTR
"\n", i, result[i]);
444 template<
class ControlFlowGraph,
class DominanceGraph>
446 Dominance::build_postdom_graph_from_cfg(
const ControlFlowGraph &cfg,
447 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
448 DominanceGraph &result)
450 RelationMap<ControlFlowGraph> pdoms;
451 build_postdom_relation_from_cfg(cfg, start, pdoms);
452 build_graph_from_relation(cfg, pdoms, result);
455 template<
class ControlFlowGraph,
class DominanceGraph>
457 Dominance::build_postdom_graph_from_cfg(
const ControlFlowGraph &cfg,
458 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
459 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop,
460 DominanceGraph &result)
462 RelationMap<ControlFlowGraph> pdoms;
463 build_postdom_relation_from_cfg(cfg, start, stop, pdoms);
464 build_graph_from_relation(cfg, pdoms, result);
467 template<
class DominanceGraph,
class ControlFlowGraph>
469 Dominance::build_postdom_graph_from_cfg(
const ControlFlowGraph &cfg,
470 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
473 build_postdom_graph_from_cfg(cfg, start, dg);
477 template<
class DominanceGraph,
class ControlFlowGraph>
479 Dominance::build_postdom_graph_from_cfg(
const ControlFlowGraph &cfg,
480 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
481 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop)
484 build_postdom_graph_from_cfg(cfg, start, stop, dg);
488 template<
class ControlFlowGraph>
489 Dominance::RelationMap<ControlFlowGraph>
490 Dominance::build_postdom_relation_from_cfg(
const ControlFlowGraph &cfg,
491 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start)
493 RelationMap<ControlFlowGraph> pdom;
494 build_postdom_relation_from_cfg(cfg, start, pdom);
498 template<
class ControlFlowGraph>
499 Dominance::RelationMap<ControlFlowGraph>
500 Dominance::build_postdom_relation_from_cfg(
const ControlFlowGraph &cfg,
501 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
502 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop)
504 RelationMap<ControlFlowGraph> pdom;
505 build_postdom_relation_from_cfg(cfg, start, stop, pdom);
509 template<
class ControlFlowGraph>
511 Dominance::build_postdom_relation_from_cfg(
const ControlFlowGraph &cfg,
512 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
513 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor stop,
514 RelationMap<ControlFlowGraph> &result)
518 fprintf(debug,
" Calling build_idom_relation_from_cfg() on reversed CFG...\n");
519 typedef typename boost::reverse_graph<ControlFlowGraph> ReversedControlFlowGraph;
520 ReversedControlFlowGraph rcfg(cfg);
521 RelationMap<ReversedControlFlowGraph> rrelation;
522 build_idom_relation_from_cfg(rcfg, stop, rrelation);
523 result.assign(rrelation.begin(), rrelation.end());
526 template<
class ControlFlowGraph>
528 Dominance::build_postdom_relation_from_cfg(
const ControlFlowGraph &cfg,
529 typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor start,
530 RelationMap<ControlFlowGraph> &result)
533 fprintf(debug,
"Rose::BinaryAnalysis::Dominance::build_postdom_relation_from_cfg: starting at vertex %" PRIuPTR
"\n", start);
534 SgAsmBlock *block =
get(boost::vertex_name, cfg, start);
537 fprintf(debug,
" Vertex %" PRIuPTR
" is %s block of", start, func->
get_entry_block()==block?
"the entry":
"a");
539 fprintf(debug,
" an unnamed function");
541 fprintf(debug,
" function <%s>", func->
get_name().c_str());
543 fprintf(debug,
" at 0x%08" PRIx64
"\n", func->
get_entry_va());
549 typedef typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor CFG_Vertex;
550 std::vector<CFG_Vertex> retblocks = ControlFlow().return_blocks(cfg, start);
551 if (1==retblocks.size()) {
553 fprintf(debug,
" CFG has unique exit vertex %" PRIuPTR
", block 0x%08" PRIx64
"\n",
555 get(boost::vertex_name, cfg, retblocks[0])->get_address());
556 build_postdom_relation_from_cfg(cfg, start, retblocks[0], result);
557 }
else if (0==retblocks.size()) {
564 fprintf(debug,
" CFG has no exit or terminal vertex; post-dominance cannot be calculated\n");
565 result.insert(result.begin(), num_vertices(cfg), boost::graph_traits<ControlFlowGraph>::null_vertex());
569 assert(!retblocks.empty());
570 CFG_Vertex unique_exit = add_vertex(cfg_copy);
571 put(boost::vertex_name, cfg_copy, unique_exit, (
SgAsmBlock*)0);
572 for (
size_t i=0; i<retblocks.size(); i++)
573 add_edge(retblocks[i], unique_exit, cfg_copy);
575 fprintf(debug,
" CFG has %" PRIuPTR
" exit blocks. Added unique exit vertex %" PRIuPTR
"\n", retblocks.size(), unique_exit);
578 build_postdom_relation_from_cfg(cfg_copy, start, unique_exit, result);
581 assert(unique_exit+1==num_vertices(cfg_copy));
583 for (
size_t i=0; i<result.size(); ++i) {
584 if (result[i]>=result.size())
585 result[i] = boost::graph_traits<ControlFlowGraph>::null_vertex();
590 fprintf(debug,
" Final result:\n");
591 for (
size_t i=0; i<result.size(); i++) {
592 if (result[i]==boost::graph_traits<ControlFlowGraph>::null_vertex()) {
593 fprintf(debug,
" CFG vertex %" PRIuPTR
" has no immediate post dominator\n", i);
595 fprintf(debug,
" CFG vertex %" PRIuPTR
" has immediate post dominator %" PRIuPTR
"\n", i, result[i]);
608 template<
class DominanceGraph,
class ControlFlowGraph>
610 Dominance::build_graph_from_relation(
const ControlFlowGraph &cfg,
611 const RelationMap<ControlFlowGraph> &relmap)
614 build_graph_from_relation(cfg, relmap, g);
618 template<
class ControlFlowGraph,
class DominanceGraph>
620 Dominance::build_graph_from_relation(
const ControlFlowGraph &cfg,
621 const RelationMap<ControlFlowGraph> &relmap,
624 typedef typename boost::graph_traits<DominanceGraph>::vertex_descriptor D_Vertex;
625 typedef typename boost::graph_traits<ControlFlowGraph>::vertex_descriptor CFG_Vertex;
628 fprintf(debug,
"Rose::BinaryAnalysis::Dominance::build_graph_from_relation:\n");
629 fprintf(debug,
" building from this relation:\n");
630 for (
size_t i=0; i<relmap.size(); i++) {
631 if (relmap[i]==boost::graph_traits<ControlFlowGraph>::null_vertex()) {
632 fprintf(debug,
" CFG vertex %" PRIuPTR
" has no immediate dominator\n", i);
634 fprintf(debug,
" CFG vertex %" PRIuPTR
" has immediate dominator %" PRIuPTR
"\n", i, relmap[i]);
640 typename boost::graph_traits<ControlFlowGraph>::vertex_iterator vi, vi_end;
641 for (boost::tie(vi, vi_end)=vertices(cfg); vi!=vi_end; vi++) {
642 D_Vertex v = add_vertex(dg);
644 SgAsmBlock *block =
get(boost::vertex_name, cfg, *vi);
645 put(boost::vertex_name, dg, v, block);
647 for (boost::tie(vi, vi_end)=vertices(cfg); vi!=vi_end; vi++) {
648 CFG_Vertex subordinate = *vi;
649 CFG_Vertex dominator = relmap[subordinate];
650 if (dominator!=boost::graph_traits<ControlFlowGraph>::null_vertex()) {
652 fprintf(debug,
" adding edge (d,s) = (%" PRIuPTR
",%" PRIuPTR
")\n", dominator, subordinate);
653 add_edge(dominator, subordinate, dg);
void set_cached_vertex(size_t)
Property: Cached vertex for control flow graphs.
SgAsmBlock * get_entry_block() const
Function entry basic block.
Sawyer::Container::Graph< CfgVertex, CfgEdge > ControlFlowGraph
Control flow graph.
Represents a synthesized function.
Main namespace for the ROSE library.
Name space for the entire library.
void set_immediate_dominator(SgAsmBlock *)
Property: Holds the immediate dominator block in the control flow graph.
const std::string & get_name() const
Property: Name.
This class represents the base class for all IR nodes within Sage III.
SgAsmFunction * get_enclosing_function() const
Returns the function that owns this block.
rose_addr_t get_entry_va() const
Property: Primary entry address.
rose_addr_t get_address() const
Property: Starting virtual address.