From 71082e83035e565570292d6542a08c0383eacf71 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 20 Feb 2019 19:37:17 +0000 Subject: [PATCH] [OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354509 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExprCXX.cpp | 5 +---- lib/Sema/SemaStmt.cpp | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index b8431ce36e..fe1676abb9 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -752,10 +752,7 @@ ExprResult Sema::BuildCXXThrow(SourceLocation OpLoc, Expr *Ex, if (!getLangOpts().CXXExceptions && !getSourceManager().isInSystemHeader(OpLoc)) { // Delay error emission for the OpenMP device code. - if (LangOpts.OpenMP && LangOpts.OpenMPIsDevice) - diagIfOpenMPDeviceCode(OpLoc, diag::err_exceptions_disabled) << "throw"; - else - Diag(OpLoc, diag::err_exceptions_disabled) << "throw"; + targetDiag(OpLoc, diag::err_exceptions_disabled) << "throw"; } // Exceptions aren't allowed in CUDA device code. diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 5f04139090..fb5c2dacc8 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -3995,10 +3995,7 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock, if (!getLangOpts().CXXExceptions && !getSourceManager().isInSystemHeader(TryLoc)) { // Delay error emission for the OpenMP device code. - if (LangOpts.OpenMP && LangOpts.OpenMPIsDevice) - diagIfOpenMPDeviceCode(TryLoc, diag::err_exceptions_disabled) << "try"; - else - Diag(TryLoc, diag::err_exceptions_disabled) << "try"; + targetDiag(TryLoc, diag::err_exceptions_disabled) << "try"; } // Exceptions aren't allowed in CUDA device code. -- 2.50.1