summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-02-26 02:19:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-02-26 02:19:19 +0000
commitc9ae8cc24c70dda33b68cacf01d2feeeb836f6f2 (patch)
treeeed8b6cf898536803dc57154dcb79363dbc6c07b /include
parent8691216d913fa82cb55423356664805abf889341 (diff)
downloadllvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.tar.gz
llvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.tar.bz2
llvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.tar.xz
Change the implementation of dominates(inst, inst) to one based on what the
verifier does. This correctly handles invoke. Thanks to Duncan, Andrew and Chris for the comments. Thanks to Joerg for the early testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/Dominators.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 5873073147..c384925e70 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -749,15 +749,11 @@ public:
return DT->dominates(A, B);
}
- // dominates - Return true if A dominates B. This performs the
- // special checks necessary if A and B are in the same basic block.
- bool dominates(const Instruction *A, const Instruction *B) const;
-
- /// properlyDominates - Use this instead of dominates() to determine whether a
- /// user of A can be hoisted above B.
- bool properlyDominates(const Instruction *A, const Instruction *B) const {
- return A != B && dominates(A, B);
- }
+ // dominates - Return true if Def dominates a use in User. This performs
+ // the special checks necessary if Def and User are in the same basic block.
+ // Note that Def doesn't dominate a use in Def itself!
+ bool dominates(const Instruction *Def, const Instruction *User) const;
+ bool dominates(const Instruction *Def, const BasicBlock *BB) const;
bool properlyDominates(const DomTreeNode *A, const DomTreeNode *B) const {
return DT->properlyDominates(A, B);