]> granicus.if.org Git - clang/commitdiff
[OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 20 Feb 2019 19:37:17 +0000 (19:37 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 20 Feb 2019 19:37:17 +0000 (19:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354509 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaStmt.cpp

index b8431ce36ec6a58da73975adef1508954c28e9ec..fe1676abb9330c6a3865db042e79e68dd2fc67f4 100644 (file)
@@ -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.
index 5f0413909093e57423f4a09b45c10779b915ddb6..fb5c2dacc8077970a6ca7a0c193111f1a30053df 100644 (file)
@@ -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.