summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp12
-rw-r--r--llvm/test/CodeGen/X86/seh-catchpad.ll2
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 75cb43d8555..919fc485398 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -221,12 +221,12 @@ void WinException::beginFunclet(const MachineBasicBlock &MBB,
const MCSymbol *PersHandlerSym =
TLOF.getCFIPersonalitySymbol(PerFn, Asm->TM, MMI);
- // Classify the personality routine so that we may reason about it.
- EHPersonality Per = classifyEHPersonality(PerFn);
-
- // Do not emit a .seh_handler directive if it is a C++ cleanup funclet.
- if (Per != EHPersonality::MSVC_CXX ||
- !CurrentFuncletEntry->isCleanupFuncletEntry())
+ // Do not emit a .seh_handler directives for cleanup funclets.
+ // FIXME: This means cleanup funclets cannot handle exceptions. Given that
+ // Clang doesn't produce EH constructs inside cleanup funclets and LLVM's
+ // inliner doesn't allow inlining them, this isn't a major problem in
+ // practice.
+ if (!CurrentFuncletEntry->isCleanupFuncletEntry())
Asm->OutStreamer->EmitWinEHHandler(PersHandlerSym, true, true);
}
}
diff --git a/llvm/test/CodeGen/X86/seh-catchpad.ll b/llvm/test/CodeGen/X86/seh-catchpad.ll
index 99ed454cfb0..b8f1753a0aa 100644
--- a/llvm/test/CodeGen/X86/seh-catchpad.ll
+++ b/llvm/test/CodeGen/X86/seh-catchpad.ll
@@ -147,7 +147,7 @@ __except.ret: ; preds = %catch.dispatch.7
; CHECK: "?dtor$[[finbb]]@?0?main@4HA":
; CHECK: .seh_proc "?dtor$[[finbb]]@?0?main@4HA"
-; CHECK: .seh_handler __C_specific_handler, @unwind, @except
+; CHECK-NOT: .seh_handler
; CHECK: .LBB1_[[finbb]]: # %ehcleanup
; CHECK: movq %rdx, 16(%rsp)
; CHECK: pushq %rbp
OpenPOWER on IntegriCloud