aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86FrameLowering.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/X86/X86FrameLowering.cpp b/lib/Target/X86/X86FrameLowering.cpp
index 6bc349ffc1..19486f871f 100644
--- a/lib/Target/X86/X86FrameLowering.cpp
+++ b/lib/Target/X86/X86FrameLowering.cpp
@@ -35,6 +35,13 @@ using namespace llvm;
// FIXME: completely move here.
extern cl::opt<bool> ForceStackAlign;
+// FIXME: Remove once linker support is available. The feature exists only on
+// Darwin at the moment.
+static cl::opt<bool>
+GenerateCompactUnwind("gen-compact-unwind",
+ cl::desc("Generate compact unwind encoding"),
+ cl::Hidden);
+
bool X86FrameLowering::hasReservedCallFrame(const MachineFunction &MF) const {
return !MF.getFrameInfo()->hasVarSizedObjects();
}
@@ -901,7 +908,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
}
// Darwin 10.7 and greater has support for compact unwind encoding.
- if (STI.getTargetTriple().isMacOSX() &&
+ if (GenerateCompactUnwind && STI.getTargetTriple().isMacOSX() &&
!STI.getTargetTriple().isMacOSXVersionLT(10, 7))
MMI.setCompactUnwindEncoding(getCompactUnwindEncoding(MF));
}