OSDN Git Service

[codeview] Disable FPO in functions using EH funclets
authorReid Kleckner <rnk@google.com>
Thu, 12 Oct 2017 00:06:57 +0000 (00:06 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 12 Oct 2017 00:06:57 +0000 (00:06 +0000)
Funclets are emitted by WinException which doesn't have access to
X86TargetStreamer so it's hard to make a quick fix for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315538 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86FrameLowering.cpp

index 1c938d9..667baba 100644 (file)
@@ -62,6 +62,10 @@ bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   EmitFPOData =
       Subtarget->isTargetWin32() && MF.getMMI().getModule()->getCodeViewFlag();
 
+  // FIXME: EH
+  if (MF->hasEHFunclets())
+    EmitFPOData = false;
+
   SetupMachineFunction(MF);
 
   if (Subtarget->isTargetCOFF()) {
index dd68cb1..4b895ba 100644 (file)
@@ -952,6 +952,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
   bool IsWin64Prologue = MF.getTarget().getMCAsmInfo()->usesWindowsCFI();
   bool NeedsWin64CFI = IsWin64Prologue && Fn->needsUnwindTableEntry();
   bool NeedsWinFPO = STI.isTargetWin32() && MMI.getModule()->getCodeViewFlag();
+  NeedsWinFPO &= !MF->hasEHFunclets(); // FIXME
   bool NeedsWinCFI = NeedsWin64CFI || NeedsWinFPO;
   bool NeedsDwarfCFI =
       !IsWin64Prologue && (MMI.hasDebugInfo() || Fn->needsUnwindTableEntry());