aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-18 23:00:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-18 23:00:28 +0000
commit00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba (patch)
treec08d00f602cf77c19b261821a52db7a811258080 /llvm/lib/CodeGen/MachineInstr.cpp
parent338863a5467f78f48aa5fb57e15704fc2364ec13 (diff)
downloadllvm-00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba.zip
llvm-00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba.tar.gz
llvm-00f6c7754b3611fc0bbfe9e0f70de5df1a1af3ba.tar.bz2
Verify bundle flag consistency when setting them.
Now that the bundle flag aware APIs are all in place, it is possible to continuously verify the flag consistency. llvm-svn: 170465
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 2d4392c..3b83d02 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -878,6 +878,7 @@ void MachineInstr::bundleWithPred() {
setFlag(BundledPred);
MachineBasicBlock::instr_iterator Pred = this;
--Pred;
+ assert(!Pred->isBundledWithSucc() && "Inconsistent bundle flags");
Pred->setFlag(BundledSucc);
}
@@ -886,6 +887,7 @@ void MachineInstr::bundleWithSucc() {
setFlag(BundledSucc);
MachineBasicBlock::instr_iterator Succ = this;
++Succ;
+ assert(!Succ->isBundledWithPred() && "Inconsistent bundle flags");
Succ->setFlag(BundledPred);
}
@@ -894,6 +896,7 @@ void MachineInstr::unbundleFromPred() {
clearFlag(BundledPred);
MachineBasicBlock::instr_iterator Pred = this;
--Pred;
+ assert(Pred->isBundledWithSucc() && "Inconsistent bundle flags");
Pred->clearFlag(BundledSucc);
}
@@ -902,6 +905,7 @@ void MachineInstr::unbundleFromSucc() {
clearFlag(BundledSucc);
MachineBasicBlock::instr_iterator Succ = this;
--Succ;
+ assert(Succ->isBundledWithPred() && "Inconsistent bundle flags");
Succ->clearFlag(BundledPred);
}