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. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits