[llvm-commits] [llvm] r165050 - /llvm/trunk/lib/Target/X86/X86FrameLowering.cpp

Eric Christopher echristo at apple.com
Tue Oct 2 14:16:53 PDT 2012


Author: echristo
Date: Tue Oct  2 16:16:53 2012
New Revision: 165050

URL: http://llvm.org/viewvc/llvm-project?rev=165050&view=rev
Log:
Make the location a parameter since we may not want the next one
in the block.

Modified:
    llvm/trunk/lib/Target/X86/X86FrameLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=165050&r1=165049&r2=165050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Tue Oct  2 16:16:53 2012
@@ -146,7 +146,8 @@
 void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI,
                   unsigned StackPtr, int64_t NumBytes,
                   bool Is64Bit, bool UseLEA,
-                  const TargetInstrInfo &TII, const TargetRegisterInfo &TRI) {
+                  const TargetInstrInfo &TII, const TargetRegisterInfo &TRI,
+		  DebugLoc DL) {
   bool isSub = NumBytes < 0;
   uint64_t Offset = isSub ? -NumBytes : NumBytes;
   unsigned Opc;
@@ -158,7 +159,6 @@
       : getADDriOpcode(Is64Bit, Offset);
 
   uint64_t Chunk = (1LL << 31) - 1;
-  DebugLoc DL = MBB.findDebugLoc(MBBI);
 
   while (Offset) {
     uint64_t ThisVal = (Offset > Chunk) ? Chunk : Offset;
@@ -912,7 +912,7 @@
     // FIXME: %rax preserves the offset and should be available.
     if (isSPUpdateNeeded)
       emitSPUpdate(MBB, MBBI, StackPtr, -(int64_t)NumBytes, Is64Bit,
-                   UseLEA, TII, *RegInfo);
+                   UseLEA, TII, *RegInfo, MBB.findDebugLoc(MBBI));
 
     if (isEAXAlive) {
         // Restore EAX
@@ -924,7 +924,7 @@
     }
   } else if (NumBytes)
     emitSPUpdate(MBB, MBBI, StackPtr, -(int64_t)NumBytes, Is64Bit,
-                 UseLEA, TII, *RegInfo);
+                 UseLEA, TII, *RegInfo, MBB.findDebugLoc(MBBI));
 
   // If we need a base pointer, set it up here. It's whatever the value
   // of the stack pointer is at this point. Any variable size objects
@@ -1075,7 +1075,8 @@
     }
   } else if (NumBytes) {
     // Adjust stack pointer back: ESP += numbytes.
-    emitSPUpdate(MBB, MBBI, StackPtr, NumBytes, Is64Bit, UseLEA, TII, *RegInfo);
+    emitSPUpdate(MBB, MBBI, StackPtr, NumBytes, Is64Bit, UseLEA, TII,
+		 *RegInfo, MBB.findDebugLoc(MBBI));
   }
 
   // We're returning from function via eh_return.
@@ -1110,7 +1111,8 @@
     if (Offset) {
       // Check for possible merge with preceding ADD instruction.
       Offset += mergeSPUpdates(MBB, MBBI, StackPtr, true);
-      emitSPUpdate(MBB, MBBI, StackPtr, Offset, Is64Bit, UseLEA, TII, *RegInfo);
+      emitSPUpdate(MBB, MBBI, StackPtr, Offset, Is64Bit, UseLEA, TII,
+		   *RegInfo, MBB.findDebugLoc(MBBI));
     }
 
     // Jump to label or value in register.
@@ -1153,7 +1155,8 @@
 
     // Check for possible merge with preceding ADD instruction.
     delta += mergeSPUpdates(MBB, MBBI, StackPtr, true);
-    emitSPUpdate(MBB, MBBI, StackPtr, delta, Is64Bit, UseLEA, TII, *RegInfo);
+    emitSPUpdate(MBB, MBBI, StackPtr, delta, Is64Bit, UseLEA, TII,
+		 *RegInfo, MBB.findDebugLoc(MBBI));
   }
 }
 





More information about the llvm-commits mailing list