/// \brief Whether the target supports SEH __try.
bool isSEHTrySupported() const {
return getTriple().isOSWindows() &&
- (getTriple().getArch() == llvm::Triple::x86 ||
- getTriple().getArch() == llvm::Triple::x86_64);
+ getTriple().getArch() == llvm::Triple::x86_64;
}
/// \brief Return true if {|} are normal characters in the asm string.
}
void CodeGenFunction::EmitSEHTryStmt(const SEHTryStmt &S) {
+ // Reject __try on unsupported targets.
+ if (!getContext().getTargetInfo().isSEHTrySupported())
+ ErrorUnsupported(&S, "SEH '__try' on this target");
+
EnterSEHTryStmt(S);
{
JumpDest TryExit = getJumpDestInCurrentScope("__try.__leave");
else
Diag(TryLoc, diag::err_seh_try_outside_functions);
- // Reject __try on unsupported targets.
- if (!Context.getTargetInfo().isSEHTrySupported())
- Diag(TryLoc, diag::err_seh_try_unsupported);
-
return SEHTryStmt::Create(Context, IsCXXTry, TryLoc, TryBlock, Handler);
}
// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
+// FIXME: Re-enable 32-bit SEH.
+// RUNX: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - | FileCheck %s
void abort(void) __attribute__((noreturn));
void might_crash(void);
// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -fms-extensions -emit-llvm -o - \
// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=X64
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - \
-// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=X86
+// FIXME: Re-enable 32-bit SEH.
+// RUNX: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -emit-llvm -o - \
+// RUNX: | FileCheck %s --check-prefix=CHECK --check-prefix=X86
void try_body(int numerator, int denominator, int *myres) {
*myres = numerator / denominator;