aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstrBundle.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-04 22:17:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-04 22:17:31 +0000
commit7f92b7ad0aa69a961154b88df90474ac38f076ac (patch)
treeb294df0ac599fbea571da6a3c570deeaa3a0e6df /llvm/lib/CodeGen/MachineInstrBundle.cpp
parent874f01e9565541992ef6e9b35e83370533dc4ff1 (diff)
downloadllvm-7f92b7ad0aa69a961154b88df90474ac38f076ac.zip
llvm-7f92b7ad0aa69a961154b88df90474ac38f076ac.tar.gz
llvm-7f92b7ad0aa69a961154b88df90474ac38f076ac.tar.bz2
Move an assertion so it doesn't dereference end().
The R600 target has test cases that exercises this code. llvm-svn: 171538
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index ffca550..77bcd1d 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -224,14 +224,13 @@ bool llvm::finalizeBundles(MachineFunction &MF) {
bool Changed = false;
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
MachineBasicBlock &MBB = *I;
-
MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
- assert(!MII->isInsideBundle() &&
- "First instr cannot be inside bundle before finalization!");
-
MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
if (MII == MIE)
continue;
+ assert(!MII->isInsideBundle() &&
+ "First instr cannot be inside bundle before finalization!");
+
for (++MII; MII != MIE; ) {
if (!MII->isInsideBundle())
++MII;