Disable 32-bit SEH, again

Move the diagnostic back to codegen so that we can compile ATL on the
self-host bot. We don't actually end up emitting code for the __try, so
the diagnostic won't be hit.

llvm-svn: 241761
This commit is contained in:
Reid Kleckner 2015-07-08 23:57:03 +00:00
parent 1319446195
commit e7844ea7f8
5 changed files with 10 additions and 9 deletions

View File

@ -812,8 +812,7 @@ public:
/// \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.

View File

@ -1280,6 +1280,10 @@ llvm::BasicBlock *CodeGenFunction::getEHResumeBlock(bool isCleanup) {
}
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");

View File

@ -3650,10 +3650,6 @@ StmtResult Sema::ActOnSEHTryBlock(bool IsCXXTry, SourceLocation TryLoc,
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);
}

View File

@ -1,5 +1,6 @@
// 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);

View File

@ -1,7 +1,8 @@
// 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;