summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/OrderedBasicBlock.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-09-11 08:46:19 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-09-11 08:46:19 +0000
commitbf00f03f5660a5a6058550f1bdd2b48e1fd8284f (patch)
tree87544b077871dcb1cdfe872cedbd992c6f30edec /llvm/lib/Analysis/OrderedBasicBlock.cpp
parent844f035e1e14b11939ae2cc4b147379519b62c67 (diff)
downloadbcm5719-llvm-bf00f03f5660a5a6058550f1bdd2b48e1fd8284f.tar.gz
bcm5719-llvm-bf00f03f5660a5a6058550f1bdd2b48e1fd8284f.zip
[NFC] Sanitizing asserts for OrderedBasicBlock
llvm-svn: 341917
Diffstat (limited to 'llvm/lib/Analysis/OrderedBasicBlock.cpp')
-rw-r--r--llvm/lib/Analysis/OrderedBasicBlock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/OrderedBasicBlock.cpp b/llvm/lib/Analysis/OrderedBasicBlock.cpp
index 6c47651eae9..5f4fe0f7dda 100644
--- a/llvm/lib/Analysis/OrderedBasicBlock.cpp
+++ b/llvm/lib/Analysis/OrderedBasicBlock.cpp
@@ -37,6 +37,8 @@ bool OrderedBasicBlock::comesBefore(const Instruction *A,
const Instruction *Inst = nullptr;
assert(!(LastInstFound == BB->end() && NextInstPos != 0) &&
"Instruction supposed to be in NumberedInsts");
+ assert(A->getParent() == BB && "Instruction supposed to be in the block!");
+ assert(B->getParent() == BB && "Instruction supposed to be in the block!");
// Start the search with the instruction found in the last lookup round.
auto II = BB->begin();
@@ -65,6 +67,7 @@ bool OrderedBasicBlock::comesBefore(const Instruction *A,
bool OrderedBasicBlock::dominates(const Instruction *A, const Instruction *B) {
assert(A->getParent() == B->getParent() &&
"Instructions must be in the same basic block!");
+ assert(A->getParent() == BB && "Instructions must be in the tracked block!");
// First we lookup the instructions. If they don't exist, lookup will give us
// back ::end(). If they both exist, we compare the numbers. Otherwise, if NA
OpenPOWER on IntegriCloud