MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / dominates

Method dominates

ir/function.cpp:1064–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062}
1063
1064bool DomTree::dominates(const BasicBlock *a, const BasicBlock *b) const {
1065 auto *dom_a = &doms.at(a);
1066 auto *dom_b = &doms.at(b);
1067 // walk up the dominator tree of 'b' until we find 'a' or the function's entry
1068 while (true) {
1069 if (dom_b == dom_a)
1070 return true;
1071 if (dom_b == dom_b->dominator)
1072 break;
1073 dom_b = dom_b->dominator;
1074 }
1075 return false;
1076}
1077
1078void DomTree::printDot(ostream &os) const {
1079 os << "digraph {\n"

Callers 1

unrollMethod · 0.80

Calls 1

atMethod · 0.80

Tested by

no test coverage detected