From 582abddeee6bd49762d562d3e641a4e290d464be Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 18 Dec 2012 23:00:28 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170465 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 2d4392c47db..3b83d02bb09 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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); } -- 2.34.1