diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Target/X86/X86CallFrameOptimization.cpp | 6 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/push-cfi-obj.ll | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp index b1995694535..e3031b89464 100644 --- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp +++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp @@ -26,6 +26,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/IR/Function.h" @@ -130,6 +131,11 @@ bool X86CallFrameOptimization::isLegal(MachineFunction &MF) { if (STI.is64Bit()) return false; + // We can't encode multiple DW_CFA_GNU_args_size in the compact + // unwind encoding that Darwin uses. + if (STI.isTargetDarwin() && !MF.getMMI().getLandingPads().empty()) + return false; + // You would expect straight-line code between call-frame setup and // call-frame destroy. You would be wrong. There are circumstances (e.g. // CMOV_GR8 expansion of a select that feeds a function call!) where we can diff --git a/llvm/test/CodeGen/X86/push-cfi-obj.ll b/llvm/test/CodeGen/X86/push-cfi-obj.ll index fcc18e28cf7..43ab34e744b 100644 --- a/llvm/test/CodeGen/X86/push-cfi-obj.ll +++ b/llvm/test/CodeGen/X86/push-cfi-obj.ll @@ -1,4 +1,9 @@ ; RUN: llc < %s -mtriple=i686-pc-linux -filetype=obj | llvm-readobj -s -sr -sd | FileCheck %s +; RUN: llc < %s -mtriple=i686-darwin-macosx10.7 -filetype=obj | llvm-readobj -sections | FileCheck -check-prefix=DARWIN %s + +; On darwin, check that we manage to generate the compact unwind section +; DARWIN: Name: __compact_unwind +; DARWIN: Segment: __LD ; CHECK: Index: 8 ; CHECK-NEXT: Name: .eh_frame (41) |