diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-04-15 15:11:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-04-15 15:11:06 +0000 |
commit | a01cdb0e37e090c5c99db39bc1802a451bc4ecfa (patch) | |
tree | 4a8db4fe4f7d9862169a7e5e2976015c64907de3 /llvm/lib/Target/X86/X86FrameLowering.cpp | |
parent | 6826eb816a847faf476473dfc853316c5f2e1930 (diff) | |
download | bcm5719-llvm-a01cdb0e37e090c5c99db39bc1802a451bc4ecfa.tar.gz bcm5719-llvm-a01cdb0e37e090c5c99db39bc1802a451bc4ecfa.zip |
Add 129518 back with a fix for when we are producing eh just because of debug info.
Change ELF systems to use CFI for producing the EH tables. This reduces the
size of the clang binary in Debug builds from 690MB to 679MB.
llvm-svn: 129571
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index dee27a0336d..df20429bcc7 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/CommandLine.h" @@ -476,6 +477,15 @@ 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); @@ -615,7 +625,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const { emitSPUpdate(MBB, MBBI, StackPtr, -(int64_t)NumBytes, Is64Bit, TII, *RegInfo); - if ((NumBytes || PushedRegs) && needsFrameMoves) { + if (( (!HasFP && NumBytes) || PushedRegs) && needsFrameMoves) { // Mark end of stack pointer adjustment. MCSymbol *Label = MMI.getContext().CreateTempSymbol(); BuildMI(MBB, MBBI, DL, TII.get(X86::PROLOG_LABEL)).addSym(Label); |