diff options
author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-12-06 13:06:20 +0000 |
---|---|---|
committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-12-06 13:06:20 +0000 |
commit | 77ce9d3b1a4675b7df00686b7157258d3a0324b7 (patch) | |
tree | 5d88ee42fa6d8a61d561dd59cfb160c39bcc19f7 /llvm/lib/Target/X86/X86FrameLowering.cpp | |
parent | 076dfe5c12b029e9109bf898710d0296f6188f64 (diff) | |
download | bcm5719-llvm-77ce9d3b1a4675b7df00686b7157258d3a0324b7.tar.gz bcm5719-llvm-77ce9d3b1a4675b7df00686b7157258d3a0324b7.zip |
[X86] Always generate precise CFA adjustments.
This removes the code path that generate "synchronous" (only correct at call site) CFA.
We will probably want to re-introduce it once we are capable of emitting different
.eh_frame and .debug_frame sections.
Differential Revision: http://reviews.llvm.org/D14948
llvm-svn: 254874
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index 682f75c7f51..2e7ed58e340 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -2524,10 +2524,10 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, // (Pushes of argument for frame setup, callee pops for frame destroy) Amount -= InternalAmt; - // If this is a callee-pop calling convention, and we're emitting precise - // SP-based CFI, emit a CFA adjust for the amount the callee popped. - if (isDestroy && InternalAmt && DwarfCFI && !hasFP(MF) && - MMI.usePreciseUnwindInfo()) + // TODO: This is needed only if we require precise CFA. + // If this is a callee-pop calling convention, emit a CFA adjust for + // the amount the callee popped. + if (isDestroy && InternalAmt && DwarfCFI && !hasFP(MF)) BuildCFI(MBB, I, DL, MCCFIInstruction::createAdjustCfaOffset(nullptr, -InternalAmt)); @@ -2548,11 +2548,14 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, // offset to be correct at each call site, while for debugging we want // it to be more precise. int CFAOffset = Amount; - if (!MMI.usePreciseUnwindInfo()) - CFAOffset += InternalAmt; - CFAOffset = isDestroy ? -CFAOffset : CFAOffset; - BuildCFI(MBB, I, DL, - MCCFIInstruction::createAdjustCfaOffset(nullptr, CFAOffset)); + // TODO: When not using precise CFA, we also need to adjust for the + // InternalAmt here. + + if (CFAOffset) { + CFAOffset = isDestroy ? -CFAOffset : CFAOffset; + BuildCFI(MBB, I, DL, + MCCFIInstruction::createAdjustCfaOffset(nullptr, CFAOffset)); + } } return; |