|
24 | 24 | #include "clang/AST/OpenMPClause.h" |
25 | 25 | #include "clang/AST/StmtOpenMP.h" |
26 | 26 | #include "clang/AST/StmtVisitor.h" |
| 27 | +#include "clang/Basic/DiagnosticFrontend.h" |
27 | 28 | #include "clang/Basic/OpenMPKinds.h" |
28 | 29 | #include "clang/Basic/SourceManager.h" |
29 | 30 | #include "clang/CodeGen/ConstantInitBuilder.h" |
@@ -2832,25 +2833,17 @@ void CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata() { |
2832 | 2833 | } |
2833 | 2834 | switch (Kind) { |
2834 | 2835 | case llvm::OpenMPIRBuilder::EMIT_MD_TARGET_REGION_ERROR: { |
2835 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
2836 | | - DiagnosticsEngine::Error, "Offloading entry for target region in " |
2837 | | - "%0 is incorrect: either the " |
2838 | | - "address or the ID is invalid."); |
2839 | | - CGM.getDiags().Report(Loc, DiagID) << EntryInfo.ParentName; |
| 2836 | + CGM.getDiags().Report(Loc, |
| 2837 | + diag::err_target_region_offloading_entry_incorrect) |
| 2838 | + << EntryInfo.ParentName; |
2840 | 2839 | } break; |
2841 | 2840 | case llvm::OpenMPIRBuilder::EMIT_MD_DECLARE_TARGET_ERROR: { |
2842 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
2843 | | - DiagnosticsEngine::Error, "Offloading entry for declare target " |
2844 | | - "variable %0 is incorrect: the " |
2845 | | - "address is invalid."); |
2846 | | - CGM.getDiags().Report(Loc, DiagID) << EntryInfo.ParentName; |
| 2841 | + CGM.getDiags().Report( |
| 2842 | + Loc, diag::err_target_var_offloading_entry_incorrect_with_parent) |
| 2843 | + << EntryInfo.ParentName; |
2847 | 2844 | } break; |
2848 | 2845 | case llvm::OpenMPIRBuilder::EMIT_MD_GLOBAL_VAR_LINK_ERROR: { |
2849 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
2850 | | - DiagnosticsEngine::Error, |
2851 | | - "Offloading entry for declare target variable is incorrect: the " |
2852 | | - "address is invalid."); |
2853 | | - CGM.getDiags().Report(DiagID); |
| 2846 | + CGM.getDiags().Report(diag::err_target_var_offloading_entry_incorrect); |
2854 | 2847 | } break; |
2855 | 2848 | } |
2856 | 2849 | }; |
@@ -11988,33 +11981,22 @@ static void emitAArch64DeclareSimdFunction( |
11988 | 11981 | // Check the values provided via `simdlen` by the user. |
11989 | 11982 | // 1. A `simdlen(1)` doesn't produce vector signatures, |
11990 | 11983 | if (UserVLEN == 1) { |
11991 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
11992 | | - DiagnosticsEngine::Warning, |
11993 | | - "The clause simdlen(1) has no effect when targeting aarch64."); |
11994 | | - CGM.getDiags().Report(SLoc, DiagID); |
| 11984 | + CGM.getDiags().Report(SLoc, diag::warn_simdlen_1_no_effect); |
11995 | 11985 | return; |
11996 | 11986 | } |
11997 | 11987 |
|
11998 | 11988 | // 2. Section 3.3.1, item 1: user input must be a power of 2 for |
11999 | 11989 | // Advanced SIMD output. |
12000 | 11990 | if (ISA == 'n' && UserVLEN && !llvm::isPowerOf2_32(UserVLEN)) { |
12001 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
12002 | | - DiagnosticsEngine::Warning, "The value specified in simdlen must be a " |
12003 | | - "power of 2 when targeting Advanced SIMD."); |
12004 | | - CGM.getDiags().Report(SLoc, DiagID); |
| 11991 | + CGM.getDiags().Report(SLoc, diag::warn_simdlen_requires_power_of_2); |
12005 | 11992 | return; |
12006 | 11993 | } |
12007 | 11994 |
|
12008 | 11995 | // 3. Section 3.4.1. SVE fixed lengh must obey the architectural |
12009 | 11996 | // limits. |
12010 | 11997 | if (ISA == 's' && UserVLEN != 0) { |
12011 | 11998 | if ((UserVLEN * WDS > 2048) || (UserVLEN * WDS % 128 != 0)) { |
12012 | | - unsigned DiagID = CGM.getDiags().getCustomDiagID( |
12013 | | - DiagnosticsEngine::Warning, "The clause simdlen must fit the %0-bit " |
12014 | | - "lanes in the architectural constraints " |
12015 | | - "for SVE (min is 128-bit, max is " |
12016 | | - "2048-bit, by steps of 128-bit)"); |
12017 | | - CGM.getDiags().Report(SLoc, DiagID) << WDS; |
| 11999 | + CGM.getDiags().Report(SLoc, diag::warn_simdlen_must_fit_lanes) << WDS; |
12018 | 12000 | return; |
12019 | 12001 | } |
12020 | 12002 | } |
|
0 commit comments