[llvm-commits] [llvm] r67649 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Evan Cheng evan.cheng at apple.com
Tue Mar 24 13:33:17 PDT 2009


Author: evancheng
Date: Tue Mar 24 15:33:17 2009
New Revision: 67649

URL: http://llvm.org/viewvc/llvm-project?rev=67649&view=rev
Log:
Fix PR3845: Avoid stale MachineInstruction pointer reference.

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

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=67649&r1=67648&r2=67649&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Tue Mar 24 15:33:17 2009
@@ -513,8 +513,6 @@
     int SPAdj = 0;  // SP offset due to call frame setup / destroy.
     if (RS) RS->enterBasicBlock(BB);
     for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) {
-      MachineInstr *MI = I;
-
       if (I->getOpcode() == TargetInstrInfo::DECLARE) {
         // Ignore it.
         ++I;
@@ -545,8 +543,8 @@
         continue;
       }
 
+      MachineInstr *MI = I;
       bool DoIncr = true;
-
       for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
         if (MI->getOperand(i).isFI()) {
           // Some instructions (e.g. inline asm instructions) can have





More information about the llvm-commits mailing list