summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-02-05 02:08:50 +0000
committerNico Weber <nicolasweber@gmx.de>2015-02-05 02:08:50 +0000
commit94b2368c246849a41abcd2abb87054d058f96ab8 (patch)
tree345477e579c85a453c3ce426035983996209e3f7 /clang/lib/Sema/SemaStmt.cpp
parent08928f308b0a7a738e1e9a14d0531db00cd8bf15 (diff)
downloadbcm5719-llvm-94b2368c246849a41abcd2abb87054d058f96ab8.tar.gz
bcm5719-llvm-94b2368c246849a41abcd2abb87054d058f96ab8.zip
Revert r228258.
It caused a chromium base unittest that tests throwing and catching SEH exceptions to fail (http://crbug.com/455488) and I suspect it might also be the cause of the chromium clang win 64-bit shared release builder timing out during compiles. So revert to see if that's true. llvm-svn: 228262
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 4761c32f78d..d17cf227011 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -3303,12 +3303,11 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
if (getCurScope() && getCurScope()->isOpenMPSimdDirectiveScope())
Diag(TryLoc, diag::err_omp_simd_region_cannot_use_stmt) << "try";
- sema::FunctionScopeInfo *FSI = getCurFunction();
-
// C++ try is incompatible with SEH __try.
- if (!getLangOpts().Borland && FSI->FirstSEHTryLoc.isValid()) {
+ if (!getLangOpts().Borland && getCurFunction()->FirstSEHTryLoc.isValid()) {
Diag(TryLoc, diag::err_mixing_cxx_try_seh_try);
- Diag(FSI->FirstSEHTryLoc, diag::note_conflicting_try_here) << "'__try'";
+ Diag(getCurFunction()->FirstSEHTryLoc, diag::note_conflicting_try_here)
+ << "'__try'";
}
const unsigned NumHandlers = Handlers.size();
@@ -3353,7 +3352,7 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
}
}
- FSI->setHasCXXTry(TryLoc);
+ getCurFunction()->setHasCXXTry(TryLoc);
// FIXME: We should detect handlers that cannot catch anything because an
// earlier handler catches a superclass. Need to find a method that is not
@@ -3368,29 +3367,15 @@ StmtResult Sema::ActOnSEHTryBlock(bool IsCXXTry, SourceLocation TryLoc,
Stmt *TryBlock, Stmt *Handler) {
assert(TryBlock && Handler);
- sema::FunctionScopeInfo *FSI = getCurFunction();
-
// SEH __try is incompatible with C++ try. Borland appears to support this,
// however.
- if (!getLangOpts().Borland) {
- if (FSI->FirstCXXTryLoc.isValid()) {
- Diag(TryLoc, diag::err_mixing_cxx_try_seh_try);
- Diag(FSI->FirstCXXTryLoc, diag::note_conflicting_try_here) << "'try'";
- }
+ if (!getLangOpts().Borland && getCurFunction()->FirstCXXTryLoc.isValid()) {
+ Diag(TryLoc, diag::err_mixing_cxx_try_seh_try);
+ Diag(getCurFunction()->FirstCXXTryLoc, diag::note_conflicting_try_here)
+ << "'try'";
}
- FSI->setHasSEHTry(TryLoc);
-
- // Reject __try in Obj-C methods, blocks, and captured decls, since we don't
- // track if they use SEH.
- DeclContext *DC = CurContext;
- while (DC && !DC->isFunctionOrMethod())
- DC = DC->getParent();
- FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(DC);
- if (FD)
- FD->setUsesSEHTry(true);
- else
- Diag(TryLoc, diag::err_seh_try_outside_functions);
+ getCurFunction()->setHasSEHTry(TryLoc);
return SEHTryStmt::Create(Context, IsCXXTry, TryLoc, TryBlock, Handler);
}
OpenPOWER on IntegriCloud