Changed disabled code into a flag.
authorBill Wendling <isanbard@gmail.com>
Mon, 25 Jul 2011 18:04:49 +0000 (18:04 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 25 Jul 2011 18:04:49 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135924 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FrameLowering.cpp

index 189c80d5f22d26851befcaa480442d44ef00f252..c64fbdbcdd340b9f7af1253ac0ca6683516c5008 100644 (file)
@@ -34,6 +34,12 @@ using namespace llvm;
 // FIXME: completely move here.
 extern cl::opt<bool> ForceStackAlign;
 
+// FIXME: Remove once linker support is available.
+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();
 }
@@ -897,7 +903,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
   }
 
   // Darwin 10.7 and greater has support for compact unwind encoding.
-  if (false && // FIXME: Enable once linker support is available.
+  if (GenerateCompactUnwind &&
       STI.isTargetDarwin() && !STI.getTargetTriple().isMacOSXVersionLT(10, 6))
     MMI.setCompactUnwindEncoding(getCompactUnwindEncoding(MF));
 }