[llvm] r304367 - [EH] Recognize __(gxx|gcc)_personality_seh0 as the GNU EH personalities
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 15:35:52 PDT 2017
Author: rnk
Date: Wed May 31 17:35:52 2017
New Revision: 304367
URL: http://llvm.org/viewvc/llvm-project?rev=304367&view=rev
Log:
[EH] Recognize __(gxx|gcc)_personality_seh0 as the GNU EH personalities
These are no-ops when there are no invokes. We don't need to emit LSDAs
for them.
Fixes PR33220.
Added:
llvm/trunk/test/CodeGen/X86/gnu-seh-nolpads.ll
Modified:
llvm/trunk/lib/Analysis/EHPersonalities.cpp
Modified: llvm/trunk/lib/Analysis/EHPersonalities.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EHPersonalities.cpp?rev=304367&r1=304366&r2=304367&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/EHPersonalities.cpp (original)
+++ llvm/trunk/lib/Analysis/EHPersonalities.cpp Wed May 31 17:35:52 2017
@@ -27,8 +27,10 @@ EHPersonality llvm::classifyEHPersonalit
return StringSwitch<EHPersonality>(F->getName())
.Case("__gnat_eh_personality", EHPersonality::GNU_Ada)
.Case("__gxx_personality_v0", EHPersonality::GNU_CXX)
+ .Case("__gxx_personality_seh0",EHPersonality::GNU_CXX)
.Case("__gxx_personality_sj0", EHPersonality::GNU_CXX_SjLj)
.Case("__gcc_personality_v0", EHPersonality::GNU_C)
+ .Case("__gcc_personality_seh0",EHPersonality::GNU_C)
.Case("__gcc_personality_sj0", EHPersonality::GNU_C_SjLj)
.Case("__objc_personality_v0", EHPersonality::GNU_ObjC)
.Case("_except_handler3", EHPersonality::MSVC_X86SEH)
Added: llvm/trunk/test/CodeGen/X86/gnu-seh-nolpads.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/gnu-seh-nolpads.ll?rev=304367&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/gnu-seh-nolpads.ll (added)
+++ llvm/trunk/test/CodeGen/X86/gnu-seh-nolpads.ll Wed May 31 17:35:52 2017
@@ -0,0 +1,34 @@
+; RUN: llc -mtriple=x86_64-windows-gnu < %s | FileCheck %s
+
+declare void @throwit()
+declare void @__gxx_personality_seh0(...)
+declare void @__gcc_personality_seh0(...)
+
+define void @use_gxx_seh()
+ personality void (...)* @__gxx_personality_seh0 {
+entry:
+ call void @throwit()
+ unreachable
+}
+
+; CHECK-LABEL: use_gxx_seh:
+; CHECK: .seh_proc use_gxx_seh
+; CHECK-NOT: .seh_handler __gxx_personality_seh0
+; CHECK: callq throwit
+; CHECK: .seh_handlerdata
+; CHECK: .seh_endproc
+
+define void @use_gcc_seh()
+ personality void (...)* @__gcc_personality_seh0 {
+entry:
+ call void @throwit()
+ unreachable
+}
+
+; CHECK-LABEL: use_gcc_seh:
+; CHECK: .seh_proc use_gcc_seh
+; CHECK-NOT: .seh_handler __gcc_personality_seh0
+; CHECK: callq throwit
+; CHECK: .seh_handlerdata
+; CHECK: .seh_endproc
+
More information about the llvm-commits
mailing list