1//==--- DiagnosticFrontendKinds.td - frontend diagnostics -----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9class BackendInfo : CatBackend, ShowInSystemHeader;
10
11let Component = "Frontend" in {
12
13def err_fe_error_opening : Error<"error opening '%0': %1">;
14def err_fe_error_reading : Error<"error reading '%0'">;
15def err_fe_error_reading_stdin : Error<"error reading stdin: %0">;
16def err_fe_error_backend : Error<"error in backend: %0">, DefaultFatal;
17
18def err_fe_inline_asm : Error<"%0">, CatInlineAsm;
19def warn_fe_inline_asm : Warning<"%0">, CatInlineAsm, InGroup<BackendInlineAsm>;
20def note_fe_inline_asm : Note<"%0">, CatInlineAsm;
21def note_fe_inline_asm_here : Note<"instantiated into assembly here">;
22def err_fe_source_mgr : Error<"%0">, CatSourceMgr;
23def warn_fe_source_mgr : Warning<"%0">, CatSourceMgr, InGroup<BackendSourceMgr>;
24def note_fe_source_mgr : Note<"%0">, CatSourceMgr;
25def err_fe_cannot_link_module : Error<"cannot link module '%0': %1">,
26  DefaultFatal;
27
28def warn_fe_frame_larger_than : Warning<"stack frame size (%0) exceeds limit (%1) in %q2">,
29    BackendInfo, InGroup<BackendFrameLargerThan>;
30def warn_fe_backend_frame_larger_than: Warning<"%0">,
31    BackendInfo, InGroup<BackendFrameLargerThan>;
32def err_fe_backend_frame_larger_than: Error<"%0">, BackendInfo;
33def note_fe_backend_frame_larger_than: Note<"%0">, BackendInfo;
34
35def warn_fe_backend_plugin: Warning<"%0">, BackendInfo, InGroup<BackendPlugin>;
36def err_fe_backend_plugin: Error<"%0">, BackendInfo;
37def remark_fe_backend_plugin: Remark<"%0">, BackendInfo, InGroup<RemarkBackendPlugin>;
38def note_fe_backend_plugin: Note<"%0">, BackendInfo;
39
40def warn_fe_override_module : Warning<
41    "overriding the module target triple with %0">,
42    InGroup<DiagGroup<"override-module">>;
43def warn_fe_backend_unsupported_fp_rounding : Warning<
44    "overriding currently unsupported rounding mode on this target">,
45    InGroup<UnsupportedFPOpt>;
46def warn_fe_backend_unsupported_fp_exceptions : Warning<
47    "overriding currently unsupported use of floating point exceptions "
48    "on this target">, InGroup<UnsupportedFPOpt>;
49
50def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo,
51    InGroup<BackendOptimizationRemark>;
52def remark_fe_backend_optimization_remark_missed : Remark<"%0">, BackendInfo,
53    InGroup<BackendOptimizationRemarkMissed>;
54def remark_fe_backend_optimization_remark_analysis : Remark<"%0">, BackendInfo,
55    InGroup<BackendOptimizationRemarkAnalysis>;
56def remark_fe_backend_optimization_remark_analysis_fpcommute : Remark<"%0; "
57    "allow reordering by specifying '#pragma clang loop vectorize(enable)' "
58    "before the loop or by providing the compiler option '-ffast-math'.">,
59    BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
60def remark_fe_backend_optimization_remark_analysis_aliasing : Remark<"%0; "
61    "allow reordering by specifying '#pragma clang loop vectorize(enable)' "
62    "before the loop. If the arrays will always be independent specify "
63    "'#pragma clang loop vectorize(assume_safety)' before the loop or provide "
64    "the '__restrict__' qualifier with the independent array arguments. "
65    "Erroneous results will occur if these options are incorrectly applied!">,
66    BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
67def warn_fe_backend_optimization_failure : Warning<"%0">, BackendInfo,
68    InGroup<BackendOptimizationFailure>, DefaultWarn;
69def note_fe_backend_invalid_loc : Note<"could "
70  "not determine the original source location for %0:%1:%2">, BackendInfo;
71
72def err_fe_backend_unsupported : Error<"%0">, BackendInfo;
73def warn_fe_backend_unsupported : Warning<"%0">, BackendInfo;
74
75def err_fe_invalid_code_complete_file : Error<
76    "cannot locate code-completion file %0">, DefaultFatal;
77def err_fe_dependency_file_requires_MT : Error<
78    "-dependency-file requires at least one -MT or -MQ option">;
79def err_fe_invalid_plugin_name : Error<
80    "unable to find plugin '%0'">;
81def err_fe_expected_compiler_job : Error<
82    "unable to handle compilation, expected exactly one compiler job in '%0'">;
83def err_fe_expected_clang_command : Error<
84    "expected a clang compiler command">;
85def err_fe_remap_missing_to_file : Error<
86    "could not remap file '%0' to the contents of file '%1'">, DefaultFatal;
87def err_fe_remap_missing_from_file : Error<
88    "could not remap from missing file '%0'">, DefaultFatal;
89def err_fe_unable_to_load_pch : Error<
90    "unable to load PCH file">;
91def err_fe_unable_to_load_plugin : Error<
92    "unable to load plugin '%0': '%1'">;
93def err_fe_unable_to_create_target : Error<
94    "unable to create target: '%0'">;
95def err_fe_unable_to_interface_with_target : Error<
96    "unable to interface with target machine">;
97def err_fe_unable_to_open_output : Error<
98    "unable to open output file '%0': '%1'">;
99def warn_fe_macro_contains_embedded_newline : Warning<
100    "macro '%0' contains embedded newline; text after the newline is ignored">;
101def warn_fe_cc_print_header_failure : Warning<
102    "unable to open CC_PRINT_HEADERS file: %0 (using stderr)">;
103def warn_fe_cc_log_diagnostics_failure : Warning<
104    "unable to open CC_LOG_DIAGNOSTICS file: %0 (using stderr)">;
105def warn_fe_unable_to_open_stats_file : Warning<
106    "unable to open statistics output file '%0': '%1'">,
107    InGroup<DiagGroup<"unable-to-open-stats-file">>;
108def err_fe_no_pch_in_dir : Error<
109    "no suitable precompiled header file found in directory '%0'">;
110def err_fe_action_not_available : Error<
111    "action %0 not compiled in">;
112def err_fe_invalid_alignment : Error<
113    "invalid value '%1' in '%0'; alignment must be a power of 2">;
114def err_fe_invalid_exception_model
115   : Error<"invalid exception model '%select{none|sjlj|seh|dwarf|wasm}0' for target '%1'">;
116def warn_fe_concepts_ts_flag : Warning<
117  "-fconcepts-ts is deprecated - use '-std=c++20' for Concepts support">,
118  InGroup<Deprecated>;
119
120def err_fe_unable_to_load_basic_block_sections_file : Error<
121    "unable to load basic block sections function list: '%0'">;
122
123def warn_fe_serialized_diag_merge_failure : Warning<
124    "unable to merge a subprocess's serialized diagnostics">,
125    InGroup<SerializedDiagnostics>;
126def warn_fe_serialized_diag_failure : Warning<
127    "unable to open file %0 for serializing diagnostics (%1)">,
128    InGroup<SerializedDiagnostics>;
129def warn_fe_serialized_diag_failure_during_finalisation : Warning<
130    "Received warning after diagnostic serialization teardown was underway: %0">,
131    InGroup<SerializedDiagnostics>;
132
133def err_verify_missing_line : Error<
134    "missing or invalid line number following '@' in expected %0">;
135def err_verify_missing_file : Error<
136    "file '%0' could not be located in expected %1">;
137def err_verify_invalid_range : Error<
138    "invalid range following '-' in expected %0">;
139def err_verify_ambiguous_marker : Error<
140    "reference to marker '%0' is ambiguous">;
141def note_verify_ambiguous_marker : Note<
142    "ambiguous marker '%0' is defined here">;
143def err_verify_no_such_marker : Error<
144    "use of undefined marker '%0'">;
145def err_verify_missing_start : Error<
146    "cannot find start ('{{') of expected %0">;
147def err_verify_missing_end : Error<
148    "cannot find end ('}}') of expected %0">;
149def err_verify_invalid_content : Error<
150    "invalid expected %0: %1">;
151def err_verify_missing_regex : Error<
152    "cannot find start of regex ('{{') in %0">;
153def err_verify_inconsistent_diags : Error<
154    "'%0' diagnostics %select{expected|seen}1 but not %select{seen|expected}1: "
155    "%2">;
156def err_verify_invalid_no_diags : Error<
157    "%select{expected|'expected-no-diagnostics'}0 directive cannot follow "
158    "%select{'expected-no-diagnostics' directive|other expected directives}0">;
159def err_verify_no_directives : Error<
160    "no expected directives found: consider use of 'expected-no-diagnostics'">;
161def err_verify_nonconst_addrspace : Error<
162  "qualifier 'const' is needed for variables in address space '%0'">;
163
164def note_fixit_applied : Note<"FIX-IT applied suggested code changes">;
165def note_fixit_in_macro : Note<
166    "FIX-IT unable to apply suggested code changes in a macro">;
167def note_fixit_failed : Note<
168    "FIX-IT unable to apply suggested code changes">;
169def note_fixit_unfixed_error : Note<"FIX-IT detected an error it cannot fix">;
170def warn_fixit_no_changes : Note<
171    "FIX-IT detected errors it could not fix; no output will be generated">;
172
173// PCH reader
174def err_relocatable_without_isysroot : Error<
175    "must specify system root with -isysroot when building a relocatable "
176    "PCH file">;
177
178def warn_unknown_diag_option : Warning<
179    "unknown %select{warning|remark}0 option '%1'%select{|; did you mean '%3'?}2">,
180    InGroup<UnknownWarningOption>;
181def warn_unknown_warning_specifier : Warning<
182    "unknown %0 warning specifier: '%1'">,
183    InGroup<UnknownWarningOption>;
184
185def warn_incompatible_analyzer_plugin_api : Warning<
186    "checker plugin '%0' is not compatible with this version of the analyzer">,
187    InGroup<DiagGroup<"analyzer-incompatible-plugin"> >;
188def note_incompatible_analyzer_plugin_api : Note<
189    "current API version is '%0', but plugin was compiled with version '%1'">;
190
191def err_module_build_requires_fmodules : Error<
192  "module compilation requires '-fmodules'">;
193def err_module_interface_requires_cpp_modules : Error<
194  "module interface compilation requires '-std=c++20' or '-fmodules-ts'">;
195def err_header_module_requires_modules : Error<
196  "header module compilation requires '-fmodules', '-std=c++20', or "
197  "'-fmodules-ts'">;
198def warn_module_config_mismatch : Warning<
199  "module file %0 cannot be loaded due to a configuration mismatch with the current "
200  "compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError;
201def err_module_map_not_found : Error<"module map file '%0' not found">,
202  DefaultFatal;
203def err_missing_module_name : Error<
204  "no module name provided; specify one with -fmodule-name=">,
205  DefaultFatal;
206def err_missing_module : Error<
207  "no module named '%0' declared in module map file '%1'">, DefaultFatal;
208def err_no_submodule : Error<"no submodule named %0 in module '%1'">;
209def err_no_submodule_suggest : Error<
210  "no submodule named %0 in module '%1'; did you mean '%2'?">;
211def warn_no_priv_submodule_use_toplevel : Warning<
212  "no submodule named %0 in module '%1'; using top level '%2'">,
213  InGroup<PrivateModule>;
214def note_private_top_level_defined : Note<
215  "module defined here">;
216def warn_missing_submodule : Warning<"missing submodule '%0'">,
217  InGroup<IncompleteUmbrella>;
218def note_module_import_here : Note<"module imported here">;
219def err_module_cannot_create_includes : Error<
220  "cannot create includes file for module %0: %1">;
221def warn_module_config_macro_undef : Warning<
222  "%select{definition|#undef}0 of configuration macro '%1' has no effect on "
223  "the import of '%2'; pass '%select{-D%1=...|-U%1}0' on the command line "
224  "to configure the module">,
225  InGroup<ConfigMacros>;
226def note_module_def_undef_here : Note<
227  "macro was %select{defined|#undef'd}0 here">;
228def remark_module_build : Remark<"building module '%0' as '%1'">,
229  InGroup<ModuleBuild>;
230def remark_module_build_done : Remark<"finished building module '%0'">,
231  InGroup<ModuleBuild>;
232def err_modules_embed_file_not_found :
233  Error<"file '%0' specified by '-fmodules-embed-file=' not found">,
234  DefaultFatal;
235def err_module_header_file_not_found :
236  Error<"module header file '%0' not found">, DefaultFatal;
237
238def err_test_module_file_extension_version : Error<
239  "test module file extension '%0' has different version (%1.%2) than expected "
240  "(%3.%4)">;
241
242def err_missing_vfs_overlay_file : Error<
243  "virtual filesystem overlay file '%0' not found">, DefaultFatal;
244def err_invalid_vfs_overlay : Error<
245  "invalid virtual filesystem overlay file '%0'">, DefaultFatal;
246
247def warn_option_invalid_ocl_version : Warning<
248  "OpenCL version %0 does not support the option '%1'">, InGroup<Deprecated>;
249
250def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
251def err_function_needs_feature : Error<
252  "always_inline function %1 requires target feature '%2', but would "
253  "be inlined into function %0 that is compiled without support for '%2'">;
254
255def warn_avx_calling_convention
256    : Warning<"AVX vector %select{return|argument}0 of type %1 without '%2' "
257              "enabled changes the ABI">,
258      InGroup<DiagGroup<"psabi">>;
259def err_avx_calling_convention : Error<warn_avx_calling_convention.Text>;
260
261def err_alias_to_undefined : Error<
262  "%select{alias|ifunc}0 must point to a defined "
263  "%select{variable or |}1function">;
264def warn_alias_to_weak_alias : Warning<
265  "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of "
266  "%1 is overridden">,
267  InGroup<IgnoredAttributes>;
268def err_duplicate_mangled_name : Error<
269  "definition with same mangled name '%0' as another definition">;
270def err_cyclic_alias : Error<
271  "%select{alias|ifunc}0 definition is part of a cycle">;
272def err_ifunc_resolver_return : Error<
273  "ifunc resolver function must return a pointer">;
274
275def warn_atomic_op_misaligned : Warning<
276  "misaligned atomic operation may incur "
277  "significant performance penalty"
278  "; the expected alignment (%0 bytes) exceeds the actual alignment (%1 bytes)">,
279  InGroup<AtomicAlignment>;
280
281def warn_atomic_op_oversized : Warning<
282  "large atomic operation may incur "
283  "significant performance penalty"
284  "; the access size (%0 bytes) exceeds the max lock-free size (%1  bytes)">,
285InGroup<AtomicAlignment>;
286
287def warn_alias_with_section : Warning<
288  "%select{alias|ifunc}1 will not be in section '%0' but in the same section "
289  "as the %select{aliasee|resolver}2">,
290  InGroup<IgnoredAttributes>;
291
292let CategoryName = "Instrumentation Issue" in {
293def warn_profile_data_out_of_date : Warning<
294  "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
295  " mismatched data that will be ignored">,
296  InGroup<ProfileInstrOutOfDate>;
297def warn_profile_data_missing : Warning<
298  "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
299  " no data">,
300  InGroup<ProfileInstrMissing>,
301  DefaultIgnore;
302def warn_profile_data_unprofiled : Warning<
303  "no profile data available for file \"%0\"">,
304  InGroup<ProfileInstrUnprofiled>;
305} // end of instrumentation issue category
306
307}
308