[llvm] r314450 - [ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn't default
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 28 12:04:14 PDT 2017
Author: mstorsjo
Date: Thu Sep 28 12:04:14 2017
New Revision: 314450
URL: http://llvm.org/viewvc/llvm-project?rev=314450&view=rev
Log:
[ARM] Fix SJLJ exception handling when manually chosen on a platform where it isn't default
Differential Revision: https://reviews.llvm.org/D38252
Modified:
llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
llvm/trunk/test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll
Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=314450&r1=314449&r2=314450&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Thu Sep 28 12:04:14 2017
@@ -150,7 +150,9 @@ void ARMSubtarget::initializeEnvironment
// MCAsmInfo isn't always present (e.g. in opt) so we can't initialize this
// directly from it, but we can try to make sure they're consistent when both
// available.
- UseSjLjEH = isTargetDarwin() && !isTargetWatchABI();
+ UseSjLjEH = (isTargetDarwin() && !isTargetWatchABI() &&
+ Options.ExceptionModel == ExceptionHandling::None) ||
+ Options.ExceptionModel == ExceptionHandling::SjLj;
assert((!TM.getMCAsmInfo() ||
(TM.getMCAsmInfo()->getExceptionHandlingType() ==
ExceptionHandling::SjLj) == UseSjLjEH) &&
Modified: llvm/trunk/test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll?rev=314450&r1=314449&r2=314450&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll Thu Sep 28 12:04:14 2017
@@ -4,6 +4,7 @@
; RUN: llc -mtriple=armv7-apple-ios -O3 < %s | FileCheck %s
; RUN: llc -mtriple=armv7-apple-watchos -O3 < %s | FileCheck %s
; RUN: llc -mtriple=armv7k-apple-ios < %s | FileCheck %s --check-prefix=CHECK-WATCH
+; RUN: llc -mtriple=armv7-linux -exception-model sjlj -O3 < %s | FileCheck %s --check-prefix=CHECK-LINUX
; SjLjEHPrepare shouldn't crash when lowering empty structs.
;
@@ -17,6 +18,12 @@ entry:
; CHECK: bl __Unwind_SjLj_Register
; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}:
; CHECK-NEXT: bl _bar
+; CHECK: bl __Unwind_SjLj_Resume
+
+; CHECK-LINUX: bl _Unwind_SjLj_Register
+; CHECK-LINUX-NEXT: .{{[A-Z][a-zA-Z0-9]*}}:
+; CHECK-LINUX-NEXT: bl bar
+; CHECK-LINUX: bl _Unwind_SjLj_Resume
; CHECK-WATCH-NOT: bl __Unwind_SjLj_Register
More information about the llvm-commits
mailing list