diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 02:19:19 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 02:19:19 +0000 |
commit | c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2 (patch) | |
tree | eed8b6cf898536803dc57154dcb79363dbc6c07b /include | |
parent | 8691216d913fa82cb55423356664805abf889341 (diff) | |
download | external_llvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.zip external_llvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.tar.gz external_llvm-c9ae8cc24c70dda33b68cacf01d2feeeb836f6f2.tar.bz2 |
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.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 5873073..c384925 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); |