[llvm-commits] [llvm] r170465 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Dec 18 15:00:28 PST 2012


Author: stoklund
Date: Tue Dec 18 17:00:28 2012
New Revision: 170465

URL: http://llvm.org/viewvc/llvm-project?rev=170465&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=170465&r1=170464&r2=170465&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Dec 18 17:00:28 2012
@@ -878,6 +878,7 @@
   setFlag(BundledPred);
   MachineBasicBlock::instr_iterator Pred = this;
   --Pred;
+  assert(!Pred->isBundledWithSucc() && "Inconsistent bundle flags");
   Pred->setFlag(BundledSucc);
 }
 
@@ -886,6 +887,7 @@
   setFlag(BundledSucc);
   MachineBasicBlock::instr_iterator Succ = this;
   ++Succ;
+  assert(!Succ->isBundledWithPred() && "Inconsistent bundle flags");
   Succ->setFlag(BundledPred);
 }
 
@@ -894,6 +896,7 @@
   clearFlag(BundledPred);
   MachineBasicBlock::instr_iterator Pred = this;
   --Pred;
+  assert(Pred->isBundledWithSucc() && "Inconsistent bundle flags");
   Pred->clearFlag(BundledSucc);
 }
 
@@ -902,6 +905,7 @@
   clearFlag(BundledSucc);
   MachineBasicBlock::instr_iterator Succ = this;
   --Succ;
+  assert(Succ->isBundledWithPred() && "Inconsistent bundle flags");
   Succ->clearFlag(BundledPred);
 }
 





More information about the llvm-commits mailing list