r241761 - Disable 32-bit SEH, again
Reid Kleckner
reid at kleckner.net
Wed Jul 8 16:57:03 PDT 2015
Author: rnk
Date: Wed Jul 8 18:57:03 2015
New Revision: 241761
URL: http://llvm.org/viewvc/llvm-project?rev=241761&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/lib/Sema/SemaStmt.cpp
cfe/trunk/test/CodeGen/exceptions-seh-finally.c
cfe/trunk/test/CodeGen/exceptions-seh.c
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=241761&r1=241760&r2=241761&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Wed Jul 8 18:57:03 2015
@@ -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.
Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=241761&r1=241760&r2=241761&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Jul 8 18:57:03 2015
@@ -1280,6 +1280,10 @@ llvm::BasicBlock *CodeGenFunction::getEH
}
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");
Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=241761&r1=241760&r2=241761&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Jul 8 18:57:03 2015
@@ -3650,10 +3650,6 @@ StmtResult Sema::ActOnSEHTryBlock(bool I
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);
}
Modified: cfe/trunk/test/CodeGen/exceptions-seh-finally.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh-finally.c?rev=241761&r1=241760&r2=241761&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exceptions-seh-finally.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh-finally.c Wed Jul 8 18:57:03 2015
@@ -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);
Modified: cfe/trunk/test/CodeGen/exceptions-seh.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh.c?rev=241761&r1=241760&r2=241761&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exceptions-seh.c (original)
+++ cfe/trunk/test/CodeGen/exceptions-seh.c Wed Jul 8 18:57:03 2015
@@ -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;
More information about the cfe-commits
mailing list