summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-29 22:01:51 +0000
committerChris Lattner <sabre@nondot.org>2004-02-29 22:01:51 +0000
commit604cc83933b2f0bb011f606c1afc92c19970de7f (patch)
treee28d6b9998c9790c988093056450657bbd60836e /llvm/lib/CodeGen/LiveVariables.cpp
parente0c3c18802214211ac5d3074375c0922783f3a49 (diff)
downloadbcm5719-llvm-604cc83933b2f0bb011f606c1afc92c19970de7f.tar.gz
bcm5719-llvm-604cc83933b2f0bb011f606c1afc92c19970de7f.zip
Add an assert
llvm-svn: 12010
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 35c64e25484..10c215885f7 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -277,7 +277,9 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
// PHI nodes are guaranteed to be at the top of the block...
for (MachineBasicBlock::iterator MI = Succ->begin(), ME = Succ->end();
MI != ME && MI->getOpcode() == TargetInstrInfo::PHI; ++MI) {
- for (unsigned i = 1; ; i += 2)
+ for (unsigned i = 1; ; i += 2) {
+ assert(MI->getNumOperands() > i+1 &&
+ "Didn't find an entry for our predecessor??");
if (MI->getOperand(i+1).getMachineBasicBlock() == MBB) {
MachineOperand &MO = MI->getOperand(i);
if (!MO.getVRegValueOrNull()) {
@@ -288,6 +290,7 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
break; // Found the PHI entry for this block...
}
}
+ }
}
}
OpenPOWER on IntegriCloud