[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman closed 
https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits


@@ -10362,12 +10362,12 @@ def err_shufflevector_argument_too_large : Error<
   "index for __builtin_shufflevector must be less than the total number "
   "of vector elements">;
 def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error<
-  "index for __builtin_shufflevector not within the bounds of the input 
vectors; index of -1 found at position %0 not permitted in a constexpr 
context.">;
+  "index for __builtin_shufflevector not within the bounds of the input 
vectors; index of -1 found at position %0 not permitted in a constexpr 
context">;

AaronBallman wrote:

SGTM, done!

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits

https://github.com/Endilll edited 
https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits

https://github.com/Endilll approved this pull request.


https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits


@@ -10362,12 +10362,12 @@ def err_shufflevector_argument_too_large : Error<
   "index for __builtin_shufflevector must be less than the total number "
   "of vector elements">;
 def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error<
-  "index for __builtin_shufflevector not within the bounds of the input 
vectors; index of -1 found at position %0 not permitted in a constexpr 
context.">;
+  "index for __builtin_shufflevector not within the bounds of the input 
vectors; index of -1 found at position %0 not permitted in a constexpr 
context">;

Endilll wrote:

```suggestion
  "index for __builtin_shufflevector not within the bounds of the input 
vectors; index of -1 found at position %0 is not permitted in a constexpr 
context">;
```

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits


@@ -4526,7 +4526,7 @@ def err_objc_attr_typedef_not_void_pointer : Error<
 def err_objc_cf_bridged_not_interface : Error<
   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
 def err_objc_ns_bridged_invalid_cfobject : Error<
-  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF 
object">;
+  "Objective-C object of type %0 is bridged to %1, which is not valid CF 
object">;

AaronBallman wrote:

Good catch, I've fixed it up

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread via cfe-commits

https://github.com/yronglin edited 
https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread via cfe-commits


@@ -4526,7 +4526,7 @@ def err_objc_attr_typedef_not_void_pointer : Error<
 def err_objc_cf_bridged_not_interface : Error<
   "CF object of type %0 is bridged to %1, which is not an Objective-C class">;
 def err_objc_ns_bridged_invalid_cfobject : Error<
-  "ObjectiveC object of type %0 is bridged to %1, which is not valid CF 
object">;
+  "Objective-C object of type %0 is bridged to %1, which is not valid CF 
object">;

yronglin wrote:

I've found `ObjectiveC` still exists in elsewhere:
https://github.com/llvm/llvm-project/blob/5a81db311cf8e15b7c6a33100bb5c1fb256754ce/clang/include/clang/Basic/DiagnosticParseKinds.td#L1120
https://github.com/llvm/llvm-project/blob/5a81db311cf8e15b7c6a33100bb5c1fb256754ce/clang/include/clang/Basic/DiagnosticSemaKinds.td#L4529


https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Cyndy Ishida via cfe-commits

https://github.com/cyndyishida approved this pull request.

the InstallAPI changes LGTM, thanks! 

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits

AaronBallman wrote:

Despite not showing up in the list of precommit CI checks for some reason, this 
did pass testing: 
https://buildkite.com/llvm-project/github-pull-requests/builds/66650

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits


@@ -337,7 +337,7 @@ def warn_atomic_op_oversized : Warning<
 InGroup;
 
 def warn_sync_op_misaligned : Warning<
-  "__sync builtin operation MUST have natural alignment (consider using 
__atomic).">,
+  "__sync builtin operation MUST have natural alignment (consider using 
__atomic)">,

AaronBallman wrote:

Heh, I'm glad you spoke up about this one -- I was on the fence about changing 
it and decided against it, but now that you've also stumbled on it, I'm going 
to fix it up. Thanks!

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Mariya Podchishchaeva via cfe-commits


@@ -337,7 +337,7 @@ def warn_atomic_op_oversized : Warning<
 InGroup;
 
 def warn_sync_op_misaligned : Warning<
-  "__sync builtin operation MUST have natural alignment (consider using 
__atomic).">,
+  "__sync builtin operation MUST have natural alignment (consider using 
__atomic)">,

Fznamznon wrote:

So, it is not allowed to capitalize a message, but a whole word written (`MUST` 
in this example) with uppercase is allowed? Isn't it too much?

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff cc3b6c3ba9c0dd7df0fd7ac23c8609c4675dd62a 
70b3ffc09709f9e5cbef4cab00f3d20adef29f35 -- 
clang/lib/Driver/ToolChains/Arch/LoongArch.cpp 
clang/lib/Driver/ToolChains/HIPSPV.cpp 
clang/lib/Frontend/SerializedDiagnosticPrinter.cpp 
clang/test/AST/Interp/builtin-functions.cpp 
clang/test/CodeGen/SystemZ/sync-builtins-i128-8Al.c 
clang/test/Driver/android-unversioned-fallback-warning.cpp 
clang/test/Driver/cl-x86-flags.c clang/test/Driver/cuda-cross-compiling.c 
clang/test/Driver/loongarch-mlasx-error.c 
clang/test/Driver/loongarch-mlsx-error.c 
clang/test/Driver/openmp-offload-infer.c clang/test/Driver/openmp-system-arch.c 
clang/test/Frontend/optimization-remark-options.c 
clang/test/Frontend/x86-target-cpu.c clang/test/OpenMP/atomic_messages.c 
clang/test/OpenMP/target_update_messages.cpp 
clang/test/Profile/misexpect-branch.c 
clang/test/Profile/misexpect-switch-default.c 
clang/test/Profile/misexpect-switch.c 
clang/test/Sema/constant_builtins_vector.cpp 
clang/test/SemaCXX/addr-label-in-coroutines.cpp 
clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-misuse.cpp 
clang/unittests/Driver/DXCModeTest.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/unittests/Driver/DXCModeTest.cpp 
b/clang/unittests/Driver/DXCModeTest.cpp
index bca73b9c1d..5a27ec0201 100644
--- a/clang/unittests/Driver/DXCModeTest.cpp
+++ b/clang/unittests/Driver/DXCModeTest.cpp
@@ -156,9 +156,10 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
   TranslatedArgs.reset(
   TC.TranslateArgs(*DAL, "0", Action::OffloadKind::OFK_None));
   EXPECT_EQ(Diags.getNumErrors(), 1u);
-  EXPECT_STREQ(DiagConsumer->Errors.back().c_str(),
-   "invalid validator version : 0.1\; if validator major version 
is "
-   "0, minor version must also be 0");
+  EXPECT_STREQ(
+  DiagConsumer->Errors.back().c_str(),
+  "invalid validator version : 0.1\; if validator major version is "
+  "0, minor version must also be 0");
   Diags.Clear();
   DiagConsumer->clear();
 

``




https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread Aaron Ballman via cfe-commits

AaronBallman wrote:

All of the issues were found using some new tooling I've not yet put up for 
review. The changes were largely mechanical (uppercase->lowercase, remove 
trailing punctuation), but there were some surgical fixes to grammar, 
punctuation, etc. Also, if the diagnostic was not emitted anywhere, it was 
removed entirely.

https://github.com/llvm/llvm-project/pull/93190
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)

2024-05-23 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)


Changes

This tries to fix all of the places where a diagnostic message starts with a 
capital letter (other than acroynyms or proper nouns) or ends with punctuation 
(other than a question mark).

This is in support of a planned change to tablegen to start diagnosing 
incorrect diagnostic message styles.

---

Patch is 161.28 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/93190.diff


39 Files Affected:

- (modified) clang/include/clang/Basic/DiagnosticCommonKinds.td (+1-1) 
- (modified) clang/include/clang/Basic/DiagnosticDriverKinds.td (+25-33) 
- (modified) clang/include/clang/Basic/DiagnosticFrontendKinds.td (+11-12) 
- (modified) clang/include/clang/Basic/DiagnosticGroups.td (-2) 
- (modified) clang/include/clang/Basic/DiagnosticInstallAPIKinds.td (+2-2) 
- (modified) clang/include/clang/Basic/DiagnosticLexKinds.td (+1-1) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+17-17) 
- (modified) clang/lib/Driver/ToolChains/Arch/LoongArch.cpp (+2-2) 
- (modified) clang/lib/Driver/ToolChains/HIPSPV.cpp (+1-1) 
- (modified) clang/lib/Frontend/SerializedDiagnosticPrinter.cpp (+1-1) 
- (modified) clang/test/AST/Interp/builtin-functions.cpp (+1-1) 
- (modified) clang/test/CodeGen/SystemZ/sync-builtins-i128-8Al.c (+4-4) 
- (modified) clang/test/Driver/android-unversioned-fallback-warning.cpp (+4-4) 
- (modified) clang/test/Driver/cl-x86-flags.c (+6-6) 
- (modified) clang/test/Driver/cuda-cross-compiling.c (+2-2) 
- (modified) clang/test/Driver/dxc_dxv_path.hlsl (+1-1) 
- (modified) clang/test/Driver/loongarch-mlasx-error.c (+2-2) 
- (modified) clang/test/Driver/loongarch-mlsx-error.c (+1-1) 
- (modified) clang/test/Driver/openmp-offload-infer.c (+1-1) 
- (modified) clang/test/Driver/openmp-system-arch.c (+1-1) 
- (modified) clang/test/Frontend/optimization-remark-options.c (+2-2) 
- (modified) clang/test/Frontend/x86-target-cpu.c (+6-6) 
- (modified) clang/test/InstallAPI/binary-attributes.test (+2-2) 
- (modified) clang/test/OpenMP/atomic_messages.c (+48-48) 
- (modified) clang/test/OpenMP/target_update_messages.cpp (+2-2) 
- (modified) clang/test/Profile/misexpect-branch.c (+4-4) 
- (modified) clang/test/Profile/misexpect-switch-default.c (+1-1) 
- (modified) clang/test/Profile/misexpect-switch.c (+1-1) 
- (modified) clang/test/Sema/constant_builtins_vector.cpp (+1-1) 
- (modified) clang/test/SemaCUDA/device-var-init.cu (+157-157) 
- (modified) clang/test/SemaCUDA/function-overload.cu (+1-1) 
- (modified) clang/test/SemaCUDA/union-init.cu (+4-4) 
- (modified) clang/test/SemaCXX/addr-label-in-coroutines.cpp (+9-9) 
- (modified) clang/test/SemaCXX/warn-unsafe-buffer-usage-pragma-misuse.cpp 
(+2-2) 
- (modified) clang/test/SemaOpenCL/vector_swizzle_length.cl (+2-2) 
- (modified) clang/unittests/Driver/DXCModeTest.cpp (+6-6) 
- (modified) flang/test/Driver/fopenmp.f90 (+1-1) 
- (modified) flang/test/Driver/w-arg-unsupported.f90 (+26-26) 
- (modified) flang/test/Driver/wextra-ok.f90 (+1-1) 


``diff
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td 
b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 0738f43ca555c..0765fa4b17a87 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -362,7 +362,7 @@ def warn_target_unrecognized_env : Warning<
   "mismatch between architecture and environment in target triple '%0'; did 
you mean '%1'?">,
   InGroup;
 def warn_knl_knm_isa_support_removed : Warning<
-  "KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be 
removed in LLVM 19.">,
+  "KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be 
removed in LLVM 19">,
   InGroup>;
 def err_target_unsupported_abi_with_fpu : Error<
   "'%0' ABI is not supported with FPU">;
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td 
b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 50d3b42c0f866..773b234cd68fe 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -58,7 +58,7 @@ def warn_drv_avr_stdlib_not_linked: Warning<
 def err_drv_cuda_bad_gpu_arch : Error<"unsupported CUDA gpu architecture: %0">;
 def err_drv_offload_bad_gpu_arch : Error<"unsupported %0 gpu architecture: 
%1">;
 def err_drv_offload_missing_gpu_arch : Error<
-  "Must pass in an explicit %0 gpu architecture to '%1'">;
+  "must pass in an explicit %0 gpu architecture to '%1'">;
 def err_drv_no_cuda_installation : Error<
   "cannot find CUDA installation; provide its path via '--cuda-path', or pass "
   "'-nocudainc' to build without CUDA includes">;
@@ -90,8 +90,8 @@ def err_drv_no_hipspv_device_lib : Error<
   "'--hip-path' or '--hip-device-lib-path', or pass '-nogpulib' to build "
   "without HIP device library">;
 def err_drv_hipspv_no_hip_path : Error<
-  "'--hip-path' must be specified when offloading