From: Rafael Espindola Date: Tue, 26 Apr 2011 03:58:56 +0000 (+0000) Subject: Print all the moves at a given label instead of just the first one. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b28d4f152ee9b76d8798b2bdcb06cb8d106841e6;p=oota-llvm.git Print all the moves at a given label instead of just the first one. Remove previous DwarfCFI hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130187 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a841ed6d60c..e4bd5a4b220 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -607,16 +607,16 @@ void AsmPrinter::emitPrologLabel(const MachineInstr &MI) { const MachineFunction &MF = *MI.getParent()->getParent(); MachineModuleInfo &MMI = MF.getMMI(); std::vector &Moves = MMI.getFrameMoves(); - const MachineMove *Move = NULL; + bool FoundOne = false; + (void)FoundOne; for (std::vector::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 diff --git a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp index b67aeb67833..6d1708a2ce8 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp @@ -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()); } } diff --git a/lib/Target/X86/X86FrameLowering.cpp b/lib/Target/X86/X86FrameLowering.cpp index df20429bcc7..06d12fc04a3 100644 --- a/lib/Target/X86/X86FrameLowering.cpp +++ b/lib/Target/X86/X86FrameLowering.cpp @@ -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);