This change also turns on -fasync-exceptions by default under -EHa
option due to the backend patch merged.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D147165
EmitBlock(NormalEntry);
// intercept normal cleanup to mark SEH scope end
- if (IsEHa) {
+ if (IsEHa && getInvokeDest()) {
if (Personality.isMSVCXXPersonality())
EmitSehCppScopeEnd();
else
if (types::isCXX(InputType))
CmdArgs.push_back("-fcxx-exceptions");
CmdArgs.push_back("-fexceptions");
+ if (EH.Asynch)
+ CmdArgs.push_back("-fasync-exceptions");
}
if (types::isCXX(InputType) && EH.Synch && EH.NoUnwindC)
CmdArgs.push_back("-fexternc-nounwind");
--- /dev/null
+// RUN: %clang_cc1 -triple x86_64-windows -fasync-exceptions -fcxx-exceptions -fexceptions -fms-extensions -x c++ -Wno-implicit-function-declaration -S -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: define dso_local void @"?foo@@YAXXZ
+// CHECK: invoke void @llvm.seh.try.begin()
+// CHECK-NOT: llvm.seh.scope.begin
+// CHECK-NOT: llvm.seh.scope.end
+
+// FIXME: Do we actually need llvm.seh.scope*?
+void foo() {
+ try {}
+ catch (...) {
+ return;
+ }
+}