diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 987ffc14a45..c7e3ed5c348 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -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"); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index c4f6fd8df1c..3ffedf28ad5 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -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); } |