r354509 - [OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 20 11:37:17 PST 2019


Author: abataev
Date: Wed Feb 20 11:37:17 2019
New Revision: 354509

URL: http://llvm.org/viewvc/llvm-project?rev=354509&view=rev
Log:
[OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.

Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaStmt.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=354509&r1=354508&r2=354509&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Feb 20 11:37:17 2019
@@ -752,10 +752,7 @@ ExprResult Sema::BuildCXXThrow(SourceLoc
   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.

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=354509&r1=354508&r2=354509&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Feb 20 11:37:17 2019
@@ -3995,10 +3995,7 @@ StmtResult Sema::ActOnCXXTryBlock(Source
   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.




More information about the cfe-commits mailing list