[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h
Devang Patel
dpatel at apple.com
Wed Jun 27 19:07:30 PDT 2007
Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.107 -> 1.108
---
Log message:
Handle the case when block dominates itself.
---
Diffs of the changes: (+4 -1)
Dominators.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.107 llvm/include/llvm/Analysis/Dominators.h:1.108
--- llvm/include/llvm/Analysis/Dominators.h:1.107 Wed Jun 27 15:53:52 2007
+++ llvm/include/llvm/Analysis/Dominators.h Wed Jun 27 21:07:08 2007
@@ -185,7 +185,7 @@
const DomTreeNode *B) const {
const DomTreeNode *IDom;
if (A == 0 || B == 0) return false;
- while ((IDom = B->getIDom()) != 0 && IDom != A)
+ while ((IDom = B->getIDom()) != 0 && IDom != A && IDom != B)
B = IDom; // Walk up the tree
return IDom != 0;
}
@@ -244,6 +244,9 @@
DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) {
assert(getNode(BB) == 0 && "Block already in dominator tree!");
DomTreeNode *IDomNode = getNode(DomBB);
+ // Check if BB dominates itself.
+ //if (!IDomNode && BB == DomBB)
+ // IDomNode = BB;
assert(IDomNode && "Not immediate dominator specified for block!");
DFSInfoValid = false;
return DomTreeNodes[BB] =
More information about the llvm-commits
mailing list