OSDN Git Service

Print all the moves at a given label instead of just the first one.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 26 Apr 2011 03:58:56 +0000 (03:58 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 26 Apr 2011 03:58:56 +0000 (03:58 +0000)
Remove previous DwarfCFI hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130187 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
lib/Target/X86/X86FrameLowering.cpp

index a841ed6..e4bd5a4 100644 (file)
@@ -607,16 +607,16 @@ void AsmPrinter::emitPrologLabel(const MachineInstr &MI) {
   const MachineFunction &MF = *MI.getParent()->getParent();
   MachineModuleInfo &MMI = MF.getMMI();
   std::vector<MachineMove> &Moves = MMI.getFrameMoves();
-  const MachineMove *Move = NULL;
+  bool FoundOne = false;
+  (void)FoundOne;
   for (std::vector<MachineMove>::iterator I = Moves.begin(),
          E = Moves.end(); I != E; ++I) {
     if (I->getLabel() == Label) {
-      Move = &*I;
-      break;
+      EmitCFIFrameMove(*I);
+      FoundOne = true;
     }
   }
-  assert(Move);
-  EmitCFIFrameMove(*Move);
+  assert(FoundOne);
 }
 
 /// EmitFunctionBody - This method emits the body and trailer for a
index b67aeb6..6d1708a 100644 (file)
@@ -300,7 +300,7 @@ void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
   } else {
     assert(!Dst.isReg() && "Machine move not supported yet.");
     OutStreamer.EmitCFIOffset(RI->getDwarfRegNum(Src.getReg(), true),
-                              -Dst.getOffset());
+                              Dst.getOffset());
   }
 }
 
index df20429..06d12fc 100644 (file)
@@ -477,15 +477,6 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
         .addReg(StackPtr);
 
     if (needsFrameMoves) {
-      const MCAsmInfo &MAI = MMI.getContext().getAsmInfo();
-      if (MAI.getExceptionHandlingType() == ExceptionHandling::DwarfCFI) {
-        MCSymbol *FrameLabel0 = MMI.getContext().CreateTempSymbol();
-        BuildMI(MBB, MBBI, DL, TII.get(X86::PROLOG_LABEL)).addSym(FrameLabel0);
-        MachineLocation FPSrc0(FramePtr);
-        MachineLocation FPDst0(FramePtr, -2 * stackGrowth);
-        Moves.push_back(MachineMove(FrameLabel0, FPDst0, FPSrc0));
-      }
-
       // Mark effective beginning of when frame pointer becomes valid.
       MCSymbol *FrameLabel = MMI.getContext().CreateTempSymbol();
       BuildMI(MBB, MBBI, DL, TII.get(X86::PROLOG_LABEL)).addSym(FrameLabel);