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': %1">;
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_linking_module : Error<"cannot link module '%0': %1">, DefaultFatal;
26def warn_fe_linking_module : Warning<"linking module '%0': %1">, InGroup<LinkerWarnings>;
27def note_fe_linking_module : Note<"linking module '%0': %1">;
28
29def warn_fe_frame_larger_than : Warning<"stack frame size (%0) exceeds limit (%1) in '%2'">,
30    BackendInfo, InGroup<BackendFrameLargerThan>;
31def warn_fe_backend_frame_larger_than: Warning<"%0">,
32    BackendInfo, InGroup<BackendFrameLargerThan>;
33def err_fe_backend_frame_larger_than: Error<"%0">, BackendInfo;
34def note_fe_backend_frame_larger_than: Note<"%0">, BackendInfo;
35
36def warn_fe_backend_plugin: Warning<"%0">, BackendInfo, InGroup<BackendPlugin>;
37def err_fe_backend_plugin: Error<"%0">, BackendInfo;
38
39def warn_fe_backend_resource_limit: Warning<"%0 (%1) exceeds limit (%2) in '%3'">, BackendInfo, InGroup<BackendPlugin>;
40def err_fe_backend_resource_limit: Error<"%0 (%1) exceeds limit (%2) in '%3'">, BackendInfo;
41def note_fe_backend_resource_limit: Note<"%0 (%1) exceeds limit (%2) in '%3'">, BackendInfo;
42
43def remark_fe_backend_plugin: Remark<"%0">, BackendInfo, InGroup<RemarkBackendPlugin>;
44def note_fe_backend_plugin: Note<"%0">, BackendInfo;
45
46def warn_fe_override_module : Warning<
47    "overriding the module target triple with %0">,
48    InGroup<DiagGroup<"override-module">>;
49def warn_fe_backend_unsupported_fp_rounding : Warning<
50    "overriding currently unsupported rounding mode on this target">,
51    InGroup<UnsupportedFPOpt>;
52def warn_fe_backend_unsupported_fp_exceptions : Warning<
53    "overriding currently unsupported use of floating point exceptions "
54    "on this target">, InGroup<UnsupportedFPOpt>;
55def warn_fe_backend_invalid_feature_flag : Warning<
56    "feature flag '%0' must start with either '+' to enable the feature or '-'"
57    " to disable it; flag ignored">, InGroup<InvalidCommandLineArgument>;
58def warn_fe_backend_readonly_feature_flag : Warning<
59    "feature flag '%0' is ignored since the feature is read only">,
60    InGroup<InvalidCommandLineArgument>;
61
62def err_incompatible_fp_eval_method_options : Error<
63    "option 'ffp-eval-method' cannot be used with option "
64    "%select{'fapprox-func'|'mreassociate'|'freciprocal'}0">;
65
66def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo,
67    InGroup<BackendOptimizationRemark>;
68def remark_fe_backend_optimization_remark_missed : Remark<"%0">, BackendInfo,
69    InGroup<BackendOptimizationRemarkMissed>;
70def remark_fe_backend_optimization_remark_analysis : Remark<"%0">, BackendInfo,
71    InGroup<BackendOptimizationRemarkAnalysis>;
72def remark_fe_backend_optimization_remark_analysis_fpcommute : Remark<"%0; "
73    "allow reordering by specifying '#pragma clang loop vectorize(enable)' "
74    "before the loop or by providing the compiler option '-ffast-math'.">,
75    BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
76def remark_fe_backend_optimization_remark_analysis_aliasing : Remark<"%0; "
77    "allow reordering by specifying '#pragma clang loop vectorize(enable)' "
78    "before the loop. If the arrays will always be independent specify "
79    "'#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!">,
82    BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>;
83
84def warn_fe_backend_optimization_failure : Warning<"%0">, BackendInfo,
85    InGroup<BackendOptimizationFailure>, DefaultWarn;
86def note_fe_backend_invalid_loc : Note<"could "
87  "not determine the original source location for %0:%1:%2">, BackendInfo;
88
89def err_fe_backend_unsupported : Error<"%0">, BackendInfo;
90def warn_fe_backend_unsupported : Warning<"%0">, BackendInfo;
91
92def err_fe_backend_error_attr :
93  Error<"call to '%0' declared with 'error' attribute: %1">, BackendInfo;
94def warn_fe_backend_warning_attr :
95  Warning<"call to '%0' declared with 'warning' attribute: %1">, BackendInfo,
96  InGroup<BackendWarningAttributes>;
97
98def err_fe_invalid_code_complete_file : Error<
99    "cannot locate code-completion file %0">, DefaultFatal;
100def err_fe_dependency_file_requires_MT : Error<
101    "-dependency-file requires at least one -MT or -MQ option">;
102def err_fe_invalid_plugin_name : Error<
103    "unable to find plugin '%0'">;
104def err_fe_expected_compiler_job : Error<
105    "unable to handle compilation, expected exactly one compiler job in '%0'">;
106def err_fe_expected_clang_command : Error<
107    "expected a clang compiler command">;
108def err_fe_remap_missing_to_file : Error<
109    "could not remap file '%0' to the contents of file '%1'">, DefaultFatal;
110def err_fe_remap_missing_from_file : Error<
111    "could not remap from missing file '%0'">, DefaultFatal;
112def err_fe_unable_to_load_pch : Error<
113    "unable to load PCH file">;
114def err_fe_unable_to_load_plugin : Error<
115    "unable to load plugin '%0': '%1'">;
116def err_fe_unable_to_create_target : Error<
117    "unable to create target: '%0'">;
118def err_fe_unable_to_interface_with_target : Error<
119    "unable to interface with target machine">;
120def err_fe_unable_to_open_output : Error<
121    "unable to open output file '%0': '%1'">;
122def warn_fe_macro_contains_embedded_newline : Warning<
123    "macro '%0' contains embedded newline; text after the newline is ignored">;
124def warn_fe_cc_print_header_failure : Warning<
125    "unable to open CC_PRINT_HEADERS file: %0 (using stderr)">;
126def warn_fe_cc_log_diagnostics_failure : Warning<
127    "unable to open CC_LOG_DIAGNOSTICS file: %0 (using stderr)">;
128def warn_fe_unable_to_open_stats_file : Warning<
129    "unable to open statistics output file '%0': '%1'">,
130    InGroup<DiagGroup<"unable-to-open-stats-file">>;
131def err_fe_no_pch_in_dir : Error<
132    "no suitable precompiled header file found in directory '%0'">;
133def err_fe_action_not_available : Error<
134    "action %0 not compiled in">;
135def err_fe_invalid_alignment : Error<
136    "invalid value '%1' in '%0'; alignment must be a power of 2">;
137def err_fe_invalid_exception_model
138   : Error<"invalid exception model '%select{none|sjlj|seh|dwarf|wasm}0' for target '%1'">;
139def err_fe_invalid_source_date_epoch : Error<
140    "environment variable 'SOURCE_DATE_EPOCH' ('%0') must be a non-negative decimal integer <= %1">;
141
142def err_fe_unable_to_load_basic_block_sections_file : Error<
143    "unable to load basic block sections function list: '%0'">;
144
145def warn_fe_serialized_diag_merge_failure : Warning<
146    "unable to merge a subprocess's serialized diagnostics">,
147    InGroup<SerializedDiagnostics>;
148def warn_fe_serialized_diag_failure : Warning<
149    "unable to open file %0 for serializing diagnostics (%1)">,
150    InGroup<SerializedDiagnostics>;
151def warn_fe_serialized_diag_failure_during_finalisation : Warning<
152    "Received warning after diagnostic serialization teardown was underway: %0">,
153    InGroup<SerializedDiagnostics>;
154
155def err_verify_missing_line : Error<
156    "missing or invalid line number following '@' in expected %0">;
157def err_verify_missing_file : Error<
158    "file '%0' could not be located in expected %1">;
159def err_verify_invalid_range : Error<
160    "invalid range following '-' in expected %0">;
161def err_verify_ambiguous_marker : Error<
162    "reference to marker '%0' is ambiguous">;
163def note_verify_ambiguous_marker : Note<
164    "ambiguous marker '%0' is defined here">;
165def err_verify_no_such_marker : Error<
166    "use of undefined marker '%0'">;
167def err_verify_missing_start : Error<
168    "cannot find start ('{{') of expected %0">;
169def err_verify_missing_end : Error<
170    "cannot find end ('}}') of expected %0">;
171def err_verify_invalid_content : Error<
172    "invalid expected %0: %1">;
173def err_verify_missing_regex : Error<
174    "cannot find start of regex ('{{') in %0">;
175def err_verify_inconsistent_diags : Error<
176    "'%0' diagnostics %select{expected|seen}1 but not %select{seen|expected}1: "
177    "%2">;
178def err_verify_invalid_no_diags : Error<
179    "%select{expected|'expected-no-diagnostics'}0 directive cannot follow "
180    "%select{'expected-no-diagnostics' directive|other expected directives}0">;
181def err_verify_no_directives : Error<
182    "no expected directives found: consider use of 'expected-no-diagnostics'">;
183def err_verify_nonconst_addrspace : Error<
184  "qualifier 'const' is needed for variables in address space '%0'">;
185
186def note_fixit_applied : Note<"FIX-IT applied suggested code changes">;
187def note_fixit_in_macro : Note<
188    "FIX-IT unable to apply suggested code changes in a macro">;
189def note_fixit_failed : Note<
190    "FIX-IT unable to apply suggested code changes">;
191def note_fixit_unfixed_error : Note<"FIX-IT detected an error it cannot fix">;
192def warn_fixit_no_changes : Note<
193    "FIX-IT detected errors it could not fix; no output will be generated">;
194
195// PCH reader
196def err_relocatable_without_isysroot : Error<
197    "must specify system root with -isysroot when building a relocatable "
198    "PCH file">;
199
200def warn_unknown_diag_option : Warning<
201    "unknown %select{warning|remark}0 option '%1'%select{|; did you mean '%3'?}2">,
202    InGroup<UnknownWarningOption>;
203def warn_unknown_warning_specifier : Warning<
204    "unknown %0 warning specifier: '%1'">,
205    InGroup<UnknownWarningOption>;
206
207def warn_incompatible_analyzer_plugin_api : Warning<
208    "checker plugin '%0' is not compatible with this version of the analyzer">,
209    InGroup<DiagGroup<"analyzer-incompatible-plugin"> >;
210def note_incompatible_analyzer_plugin_api : Note<
211    "current API version is '%0', but plugin was compiled with version '%1'">;
212
213def err_module_build_requires_fmodules : Error<
214  "module compilation requires '-fmodules'">;
215def err_module_interface_requires_cpp_modules : Error<
216  "module interface compilation requires '-std=c++20'">;
217def warn_module_config_mismatch : Warning<
218  "module file %0 cannot be loaded due to a configuration mismatch with the current "
219  "compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError;
220def err_module_map_not_found : Error<"module map file '%0' not found">,
221  DefaultFatal;
222def err_missing_module_name : Error<
223  "no module name provided; specify one with -fmodule-name=">,
224  DefaultFatal;
225def err_missing_module : Error<
226  "no module named '%0' declared in module map file '%1'">, DefaultFatal;
227def err_no_submodule : Error<"no submodule named %0 in module '%1'">;
228def err_no_submodule_suggest : Error<
229  "no submodule named %0 in module '%1'; did you mean '%2'?">;
230def warn_no_priv_submodule_use_toplevel : Warning<
231  "no submodule named %0 in module '%1'; using top level '%2'">,
232  InGroup<PrivateModule>;
233def note_private_top_level_defined : Note<
234  "module defined here">;
235def warn_missing_submodule : Warning<"missing submodule '%0'">,
236  InGroup<IncompleteUmbrella>;
237def note_module_import_here : Note<"module imported here">;
238def err_module_cannot_create_includes : Error<
239  "cannot create includes file for module %0: %1">;
240def warn_module_config_macro_undef : Warning<
241  "%select{definition|#undef}0 of configuration macro '%1' has no effect on "
242  "the import of '%2'; pass '%select{-D%1=...|-U%1}0' on the command line "
243  "to configure the module">,
244  InGroup<ConfigMacros>;
245def note_module_def_undef_here : Note<
246  "macro was %select{defined|#undef'd}0 here">;
247def remark_module_build : Remark<"building module '%0' as '%1'">,
248  ShowInSystemHeader,
249  InGroup<ModuleBuild>;
250def remark_module_build_done : Remark<"finished building module '%0'">,
251  ShowInSystemHeader,
252  InGroup<ModuleBuild>;
253def remark_module_lock : Remark<"locking '%0' to build module '%1'">,
254  InGroup<ModuleLock>;
255def err_modules_embed_file_not_found :
256  Error<"file '%0' specified by '-fmodules-embed-file=' not found">,
257  DefaultFatal;
258def err_module_header_file_not_found :
259  Error<"module header file '%0' not found">, DefaultFatal;
260
261def err_test_module_file_extension_version : Error<
262  "test module file extension '%0' has different version (%1.%2) than expected "
263  "(%3.%4)">;
264
265def warn_eagerly_load_for_standard_cplusplus_modules : Warning<
266  "the form '-fmodule-file=<BMI-path>' is deprecated for standard C++ named modules;"
267  "consider to use '-fmodule-file=<module-name>=<BMI-path>' instead">,
268  InGroup<DiagGroup<"eager-load-cxx-named-modules">>;
269
270def err_missing_vfs_overlay_file : Error<
271  "virtual filesystem overlay file '%0' not found">, DefaultFatal;
272def err_invalid_vfs_overlay : Error<
273  "invalid virtual filesystem overlay file '%0'">, DefaultFatal;
274
275def warn_option_invalid_ocl_version : Warning<
276  "%0 does not support the option '%1'">, InGroup<Deprecated>;
277
278def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
279def err_function_needs_feature : Error<
280  "always_inline function %1 requires target feature '%2', but would "
281  "be inlined into function %0 that is compiled without support for '%2'">;
282
283def warn_avx_calling_convention
284    : Warning<"AVX vector %select{return|argument}0 of type %1 without '%2' "
285              "enabled changes the ABI">,
286      InGroup<DiagGroup<"psabi">>;
287def err_avx_calling_convention : Error<warn_avx_calling_convention.Summary>;
288
289def err_alias_to_undefined : Error<
290  "%select{alias|ifunc}0 must point to a defined "
291  "%select{variable or |}1function">;
292def err_alias_to_common : Error<
293  "alias to a variable in a common section is not allowed">;
294def note_alias_requires_mangled_name : Note<
295  "the %select{function or variable|function}0 specified in an %select{alias|ifunc}1 must refer to its mangled name">;
296def note_alias_mangled_name_alternative: Note<
297  "function by that name is mangled as \"%0\"">;
298def warn_alias_to_weak_alias : Warning<
299  "%select{alias|ifunc}2 will always resolve to %0 even if weak definition of "
300  "%1 is overridden">,
301  InGroup<IgnoredAttributes>;
302def err_duplicate_mangled_name : Error<
303  "definition with same mangled name '%0' as another definition">;
304def err_cyclic_alias : Error<
305  "%select{alias|ifunc}0 definition is part of a cycle">;
306def err_hidden_visibility_dllexport : Error<
307  "hidden visibility cannot be applied to 'dllexport' declaration">;
308def err_non_default_visibility_dllimport : Error<
309  "non-default visibility cannot be applied to 'dllimport' declaration">;
310def err_ifunc_resolver_return : Error<
311  "ifunc resolver function must return a pointer">;
312
313def warn_atomic_op_misaligned : Warning<
314  "misaligned atomic operation may incur "
315  "significant performance penalty"
316  "; the expected alignment (%0 bytes) exceeds the actual alignment (%1 bytes)">,
317  InGroup<AtomicAlignment>;
318
319def warn_atomic_op_oversized : Warning<
320  "large atomic operation may incur "
321  "significant performance penalty"
322  "; the access size (%0 bytes) exceeds the max lock-free size (%1  bytes)">,
323InGroup<AtomicAlignment>;
324
325def warn_sync_op_misaligned : Warning<
326  "__sync builtin operation MUST have natural alignment (consider using __atomic).">,
327  InGroup<SyncAlignment>;
328
329def warn_alias_with_section : Warning<
330  "%select{alias|ifunc}1 will not be in section '%0' but in the same section "
331  "as the %select{aliasee|resolver}2">,
332  InGroup<IgnoredAttributes>;
333
334let CategoryName = "Instrumentation Issue" in {
335def warn_profile_data_out_of_date : Warning<
336  "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1"
337  " mismatched data that will be ignored">,
338  InGroup<ProfileInstrOutOfDate>;
339def warn_profile_data_missing : Warning<
340  "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1"
341  " no data">,
342  InGroup<ProfileInstrMissing>,
343  DefaultIgnore;
344def warn_profile_data_unprofiled : Warning<
345  "no profile data available for file \"%0\"">,
346  InGroup<ProfileInstrUnprofiled>;
347def warn_profile_data_misexpect : Warning<
348  "Potential performance regression from use of __builtin_expect(): "
349  "Annotation was correct on %0 of profiled executions.">,
350  BackendInfo,
351  InGroup<MisExpect>;
352} // end of instrumentation issue category
353
354def err_extract_api_ignores_file_not_found :
355  Error<"file '%0' specified by '--extract-api-ignores=' not found">, DefaultFatal;
356
357}
358