Skip to content

Commit b49ce9c

Browse files
authored
Fix more diagnostic wording for style; NFC (#93190)
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.
1 parent a38f015 commit b49ce9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+370
-380
lines changed

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def warn_target_unrecognized_env : Warning<
362362
"mismatch between architecture and environment in target triple '%0'; did you mean '%1'?">,
363363
InGroup<InvalidCommandLineArgument>;
364364
def warn_knl_knm_isa_support_removed : Warning<
365-
"KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be removed in LLVM 19.">,
365+
"KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be removed in LLVM 19">,
366366
InGroup<DiagGroup<"knl-knm-isa-support-removed">>;
367367
def err_target_unsupported_abi_with_fpu : Error<
368368
"'%0' ABI is not supported with FPU">;

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def warn_drv_avr_stdlib_not_linked: Warning<
5858
def err_drv_cuda_bad_gpu_arch : Error<"unsupported CUDA gpu architecture: %0">;
5959
def err_drv_offload_bad_gpu_arch : Error<"unsupported %0 gpu architecture: %1">;
6060
def err_drv_offload_missing_gpu_arch : Error<
61-
"Must pass in an explicit %0 gpu architecture to '%1'">;
61+
"must pass in an explicit %0 gpu architecture to '%1'">;
6262
def err_drv_no_cuda_installation : Error<
6363
"cannot find CUDA installation; provide its path via '--cuda-path', or pass "
6464
"'-nocudainc' to build without CUDA includes">;
@@ -90,8 +90,8 @@ def err_drv_no_hipspv_device_lib : Error<
9090
"'--hip-path' or '--hip-device-lib-path', or pass '-nogpulib' to build "
9191
"without HIP device library">;
9292
def err_drv_hipspv_no_hip_path : Error<
93-
"'--hip-path' must be specified when offloading to "
94-
"SPIR-V%select{| unless %1 is given}0.">;
93+
"'--hip-path' must be specified when offloading to SPIR-V unless '-nogpuinc' "
94+
"is given">;
9595

9696
// TODO: Remove when COV6 is fully supported by ROCm.
9797
def warn_drv_amdgpu_cov6: Warning<
@@ -137,13 +137,13 @@ def warn_drv_unsupported_option_for_flang : Warning<
137137
"the argument '%0' is not supported for option '%1'. Mapping to '%1%2'">,
138138
InGroup<OptionIgnored>;
139139
def warn_drv_unsupported_diag_option_for_flang : Warning<
140-
"The warning option '-%0' is not supported">,
140+
"the warning option '-%0' is not supported">,
141141
InGroup<OptionIgnored>;
142142
def warn_drv_unsupported_option_for_processor : Warning<
143143
"ignoring '%0' option as it is not currently supported for processor '%1'">,
144144
InGroup<OptionIgnored>;
145145
def warn_drv_unsupported_openmp_library : Warning<
146-
"The library '%0=%1' is not supported, openmp is not be enabled">,
146+
"the library '%0=%1' is not supported, OpenMP will not be enabled">,
147147
InGroup<OptionIgnored>;
148148

149149
def err_drv_invalid_thread_model_for_target : Error<
@@ -356,7 +356,7 @@ def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
356356
"compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'">;
357357
def err_drv_failed_to_deduce_target_from_arch : Error<
358358
"failed to deduce triple for target architecture '%0'; specify the triple "
359-
"using '-fopenmp-targets' and '-Xopenmp-target' instead.">;
359+
"using '-fopenmp-targets' and '-Xopenmp-target' instead">;
360360
def err_drv_omp_offload_target_missingbcruntime : Error<
361361
"no library '%0' found in the default clang lib directory or in LIBRARY_PATH"
362362
"; use '--libomptarget-%1-bc-path' to specify %1 bitcode library">;
@@ -515,14 +515,6 @@ def err_analyzer_checker_incompatible_analyzer_option : Error<
515515
def err_analyzer_not_built_with_z3 : Error<
516516
"analyzer constraint manager 'z3' is only available if LLVM was built with "
517517
"-DLLVM_ENABLE_Z3_SOLVER=ON">;
518-
def warn_analyzer_deprecated_option : Warning<
519-
"analyzer option '%0' is deprecated. This flag will be removed in %1, and "
520-
"passing this option will be an error.">,
521-
InGroup<DeprecatedStaticAnalyzerFlag>;
522-
def warn_analyzer_deprecated_option_with_alternative : Warning<
523-
"analyzer option '%0' is deprecated. This flag will be removed in %1, and "
524-
"passing this option will be an error. Use '%2' instead.">,
525-
InGroup<DeprecatedStaticAnalyzerFlag>;
526518

527519
def warn_drv_needs_hvx : Warning<
528520
"%0 requires HVX, use -mhvx/-mhvx= to enable it">,
@@ -555,10 +547,12 @@ def err_drv_extract_api_wrong_kind : Error<
555547
"in api extraction; use '-x %2' to override">;
556548

557549
def err_drv_missing_symbol_graph_dir: Error<
558-
"Must provide a symbol graph output directory using --symbol-graph-dir=<directory>">;
550+
"must provide a symbol graph output directory using "
551+
"'--symbol-graph-dir=<directory>'">;
559552

560553
def err_drv_unexpected_symbol_graph_output : Error<
561-
"Unexpected output symbol graph '%1'; please provide --symbol-graph-dir=<directory> instead">;
554+
"unexpected output symbol graph '%1'; please provide "
555+
"'--symbol-graph-dir=<directory>' instead">;
562556

563557
def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">,
564558
InGroup<DiagGroup<"slash-u-filename">>;
@@ -767,19 +761,19 @@ def err_drv_hlsl_16bit_types_unsupported: Error<
767761
"'%0' option requires target HLSL Version >= 2018%select{| and shader model >= 6.2}1, but HLSL Version is '%2'%select{| and shader model is '%3'}1">;
768762
def err_drv_hlsl_bad_shader_unsupported : Error<
769763
"%select{shader model|Vulkan environment|shader stage}0 '%1' in target '%2' is invalid for HLSL code generation">;
770-
def warn_drv_dxc_missing_dxv : Warning<"dxv not found. "
771-
"Resulting DXIL will not be validated or signed for use in release environments.">,
772-
InGroup<DXILValidation>;
764+
def warn_drv_dxc_missing_dxv : Warning<
765+
"dxv not found; resulting DXIL will not be validated or signed for use in "
766+
"release environment">, InGroup<DXILValidation>;
773767

774768
def err_drv_invalid_range_dxil_validator_version : Error<
775-
"invalid validator version : %0\n"
776-
"Validator version must be less than or equal to current internal version.">;
769+
"invalid validator version : %0; validator version must be less than or "
770+
"equal to current internal version">;
777771
def err_drv_invalid_format_dxil_validator_version : Error<
778-
"invalid validator version : %0\n"
779-
"Format of validator version is \"<major>.<minor>\" (ex:\"1.4\").">;
772+
"invalid validator version : %0; format of validator version is "
773+
"\"<major>.<minor>\" (ex:\"1.4\")">;
780774
def err_drv_invalid_empty_dxil_validator_version : Error<
781-
"invalid validator version : %0\n"
782-
"If validator major version is 0, minor version must also be 0.">;
775+
"invalid validator version : %0; if validator major version is 0, minor "
776+
"version must also be 0">;
783777

784778
def warn_drv_sarif_format_unstable : Warning<
785779
"diagnostic formatting in SARIF mode is currently unstable">,
@@ -793,12 +787,10 @@ def warn_drv_loongarch_conflicting_implied_val : Warning<
793787
InGroup<OptionIgnored>;
794788
def err_drv_loongarch_invalid_mfpu_EQ : Error<
795789
"invalid argument '%0' to -mfpu=; must be one of: 64, 32, none, 0 (alias for none)">;
796-
def err_drv_loongarch_wrong_fpu_width_for_lsx : Error<
797-
"wrong fpu width; LSX depends on 64-bit FPU.">;
798-
def err_drv_loongarch_wrong_fpu_width_for_lasx : Error<
799-
"wrong fpu width; LASX depends on 64-bit FPU.">;
790+
def err_drv_loongarch_wrong_fpu_width : Error<
791+
"wrong fpu width; %select{LSX|LASX}0 depends on 64-bit FPU">;
800792
def err_drv_loongarch_invalid_simd_option_combination : Error<
801-
"invalid option combination; LASX depends on LSX.">;
793+
"invalid option combination; LASX depends on LSX">;
802794

803795
def err_drv_expand_response_file : Error<
804796
"failed to expand response file: %0">;
@@ -810,9 +802,9 @@ def note_drv_available_multilibs : Note<
810802
"available multilibs are:%0">;
811803

812804
def warn_android_unversioned_fallback : Warning<
813-
"Using unversioned Android target directory %0 for target %1. Unversioned"
814-
" directories will not be used in Clang 19. Provide a versioned directory"
815-
" for the target version or lower instead.">,
805+
"using unversioned Android target directory %0 for target %1; unversioned "
806+
"directories will not be used in Clang 19 -- provide a versioned directory "
807+
"for the target version or lower instead">,
816808
InGroup<DiagGroup<"android-unversioned-fallback">>;
817809

818810
def err_drv_triple_version_invalid : Error<

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def remark_fe_backend_optimization_remark_analysis : Remark<"%0">, BackendInfo,
7171
InGroup<BackendOptimizationRemarkAnalysis>;
7272
def remark_fe_backend_optimization_remark_analysis_fpcommute : Remark<"%0; "
7373
"allow reordering by specifying '#pragma clang loop vectorize(enable)' "
74-
"before the loop or by providing the compiler option '-ffast-math'.">,
74+
"before the loop or by providing the compiler option '-ffast-math'">,
7575
BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
7676
def remark_fe_backend_optimization_remark_analysis_aliasing : Remark<"%0; "
7777
"allow reordering by specifying '#pragma clang loop vectorize(enable)' "
78-
"before the loop. If the arrays will always be independent specify "
78+
"before the loop; if the arrays will always be independent, specify "
7979
"'#pragma clang loop vectorize(assume_safety)' before the loop or provide "
80-
"the '__restrict__' qualifier with the independent array arguments. "
81-
"Erroneous results will occur if these options are incorrectly applied!">,
80+
"the '__restrict__' qualifier with the independent array arguments -- "
81+
"erroneous results will occur if these options are incorrectly applied">,
8282
BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
8383

8484
def warn_fe_backend_optimization_failure : Warning<"%0">, BackendInfo,
@@ -152,8 +152,8 @@ def warn_fe_serialized_diag_merge_failure : Warning<
152152
def warn_fe_serialized_diag_failure : Warning<
153153
"unable to open file %0 for serializing diagnostics (%1)">,
154154
InGroup<SerializedDiagnostics>;
155-
def warn_fe_serialized_diag_failure_during_finalisation : Warning<
156-
"Received warning after diagnostic serialization teardown was underway: %0">,
155+
def warn_fe_serialized_diag_failure_during_finalization : Warning<
156+
"received warning after diagnostic serialization teardown was underway: %0">,
157157
InGroup<SerializedDiagnostics>;
158158

159159
def err_verify_missing_line : Error<
@@ -337,7 +337,7 @@ def warn_atomic_op_oversized : Warning<
337337
InGroup<AtomicAlignment>;
338338

339339
def warn_sync_op_misaligned : Warning<
340-
"__sync builtin operation MUST have natural alignment (consider using __atomic).">,
340+
"__sync builtin operation must have natural alignment (consider using __atomic)">,
341341
InGroup<SyncAlignment>;
342342

343343
def warn_alias_with_section : Warning<
@@ -359,17 +359,16 @@ def warn_profile_data_unprofiled : Warning<
359359
"no profile data available for file \"%0\"">,
360360
InGroup<ProfileInstrUnprofiled>;
361361
def warn_profile_data_misexpect : Warning<
362-
"Potential performance regression from use of __builtin_expect(): "
363-
"Annotation was correct on %0 of profiled executions.">,
364-
BackendInfo,
365-
InGroup<MisExpect>;
362+
"potential performance regression from use of __builtin_expect(): "
363+
"annotation was correct on %0 of profiled executions">,
364+
BackendInfo, InGroup<MisExpect>;
366365
} // end of instrumentation issue category
367366

368367
def err_extract_api_ignores_file_not_found :
369368
Error<"file '%0' specified by '--extract-api-ignores=' not found">, DefaultFatal;
370369

371370
def warn_missing_symbol_graph_dir : Warning<
372-
"Missing symbol graph output directory, defaulting to working directory">,
371+
"missing symbol graph output directory, defaulting to working directory">,
373372
InGroup<ExtractAPIMisuse>;
374373

375374
def err_ast_action_on_llvm_ir : Error<

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def Implicit : DiagGroup<"implicit", [
1515
ImplicitInt
1616
]>;
1717

18-
def DeprecatedStaticAnalyzerFlag : DiagGroup<"deprecated-static-analyzer-flag">;
19-
2018
// Empty DiagGroups are recognized by clang but ignored.
2119
def ODR : DiagGroup<"odr">;
2220
def : DiagGroup<"abi">;

clang/include/clang/Basic/DiagnosticInstallAPIKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def err_platform_mismatch : Error<"platform does not match: '%0' (provided) vs '
5959
def err_install_name_mismatch : Error<"install_name does not match: '%0' (provided) vs '%1' (found)">;
6060
def err_current_version_mismatch : Error<"current_version does not match: '%0' (provided) vs '%1' (found)">;
6161
def err_compatibility_version_mismatch : Error<"compatibility_version does not match: '%0' (provided) vs '%1' (found)">;
62-
def err_appextension_safe_mismatch : Error<"ApplicationExtensionSafe flag does not match: '%0' (provided) vs '%1' (found)">;
63-
def err_shared_cache_eligiblity_mismatch : Error<"NotForDyldSharedCache flag does not match: '%0' (provided) vs '%1' (found)">;
62+
def err_appextension_safe_mismatch : Error<"the ApplicationExtensionSafe flag does not match: '%0' (provided) vs '%1' (found)">;
63+
def err_shared_cache_eligiblity_mismatch : Error<"the NotForDyldSharedCache flag does not match: '%0' (provided) vs '%1' (found)">;
6464
def err_no_twolevel_namespace : Error<"flat namespace libraries are not supported">;
6565
def err_parent_umbrella_missing: Error<"parent umbrella missing from %0: '%1'">;
6666
def err_parent_umbrella_mismatch : Error<"parent umbrella does not match: '%0' (provided) vs '%1' (found)">;

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,5 +991,5 @@ def err_pp_unclosed_pragma_unsafe_buffer_usage :
991991
Error<"'#pragma unsafe_buffer_usage' was not ended">;
992992

993993
def err_pp_pragma_unsafe_buffer_usage_syntax :
994-
Error<"Expected 'begin' or 'end'">;
994+
Error<"expected 'begin' or 'end'">;
995995
}

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ def err_availability_expected_environment : Error<
11171117

11181118
// objc_bridge_related attribute
11191119
def err_objcbridge_related_expected_related_class : Error<
1120-
"expected a related ObjectiveC class name, e.g., 'NSColor'">;
1120+
"expected a related Objective-C class name, e.g., 'NSColor'">;
11211121
def err_objcbridge_related_selector_name : Error<
11221122
"expected a class method selector with single argument, e.g., 'colorWithCGColor:'">;
11231123

0 commit comments

Comments
 (0)