xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1//==--- DiagnosticSerializationKinds.td - serialization 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
9let Component = "Serialization" in {
10let CategoryName = "AST Deserialization Issue" in {
11
12def err_fe_unable_to_read_pch_file : Error<
13    "unable to read PCH file %0: '%1'">;
14def err_fe_not_a_pch_file : Error<
15    "input is not a PCH file: '%0'">;
16def err_fe_pch_malformed : Error<
17    "malformed or corrupted AST file: '%0'">, DefaultFatal;
18def err_fe_pch_malformed_block : Error<
19    "malformed block record in PCH file: '%0'">, DefaultFatal;
20def err_fe_ast_file_modified : Error<
21    "file '%0' has been modified since the "
22    "%select{precompiled header|module file|AST file}1 '%2' was built"
23    ": %select{size|mtime|content}3 changed%select{| (was %5, now %6)}4">,
24    DefaultFatal;
25def err_fe_pch_file_overridden : Error<
26    "file '%0' from the precompiled header has been overridden">;
27def note_pch_required_by : Note<"'%0' required by '%1'">;
28def note_pch_rebuild_required : Note<"please rebuild precompiled header '%0'">;
29def note_module_cache_path : Note<
30    "after modifying system headers, please delete the module cache at '%0'">;
31
32def err_pch_targetopt_mismatch : Error<
33    "PCH file was compiled for the %0 '%1' but the current translation "
34    "unit is being compiled for target '%2'">;
35def err_pch_targetopt_feature_mismatch : Error<
36    "%select{AST file was|current translation unit is}0 compiled with the target "
37    "feature '%1' but the %select{current translation unit is|AST file was}0 "
38    "not">;
39def err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in "
40    "PCH file but is currently %select{disabled|enabled}2">;
41def err_pch_langopt_value_mismatch : Error<
42  "%0 differs in PCH file vs. current file">;
43def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
44  "the PCH file">;
45def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache "
46  "path '%0', but the path is currently '%1'">;
47def warn_pch_vfsoverlay_mismatch : Warning<
48  "PCH was compiled with different VFS overlay files than are currently in use">,
49  InGroup<DiagGroup<"pch-vfs-diff">>;
50def note_pch_vfsoverlay_files : Note<"%select{PCH|current translation unit}0 has the following VFS overlays:\n%1">;
51def note_pch_vfsoverlay_empty : Note<"%select{PCH|current translation unit}0 has no VFS overlays">;
52
53def err_pch_version_too_old : Error<
54    "PCH file uses an older PCH format that is no longer supported">;
55def err_pch_version_too_new : Error<
56    "PCH file uses a newer PCH format that cannot be read">;
57def err_pch_different_branch : Error<
58    "PCH file built from a different branch (%0) than the compiler (%1)">;
59def err_pch_with_compiler_errors : Error<
60    "PCH file contains compiler errors">;
61
62def err_module_file_conflict : Error<
63  "module '%0' is defined in both '%1' and '%2'">, DefaultFatal;
64def err_ast_file_not_found : Error<
65  "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
66def err_ast_file_out_of_date : Error<
67  "%select{PCH|module|AST}0 file '%1' is out of date and "
68  "needs to be rebuilt%select{|: %3}2">, DefaultFatal;
69def err_ast_file_invalid : Error<
70  "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file: %2">, DefaultFatal;
71def note_module_file_imported_by : Note<
72  "imported by %select{|module '%2' in }1'%0'">;
73def err_module_file_not_module : Error<
74  "AST file '%0' was not built as a module">, DefaultFatal;
75def err_module_file_missing_top_level_submodule : Error<
76  "module file '%0' is missing its top-level submodule">, DefaultFatal;
77def note_module_file_conflict : Note<
78  "this is generally caused by modules with the same name found in multiple "
79  "paths">;
80
81def remark_module_import : Remark<
82  "importing module '%0'%select{| into '%3'}2 from '%1'">,
83  ShowInSystemHeader,
84  InGroup<ModuleImport>;
85
86def err_imported_module_not_found : Error<
87    "module '%0' in AST file '%1' %select{(imported by AST file '%2') |}4"
88    "is not defined in any loaded module map file; "
89    "maybe you need to load '%3'?">, DefaultFatal;
90def note_imported_by_pch_module_not_found : Note<
91    "consider adding '%0' to the header search path">;
92def err_imported_module_modmap_changed : Error<
93    "module '%0' %select{in|imported by}4 AST file '%1' found in a different module map file"
94    " (%2) than when the importing AST file was built (%3)">, DefaultFatal;
95def err_imported_module_relocated : Error<
96    "module '%0' was built in directory '%1' but now resides in "
97    "directory '%2'">, DefaultFatal;
98def err_module_different_modmap : Error<
99    "module '%0' %select{uses|does not use}1 additional module map '%2'"
100    "%select{| not}1 used when the module was built">;
101
102def err_pch_macro_def_undef : Error<
103    "macro '%0' was %select{defined|undef'd}1 in the precompiled header but "
104    "%select{undef'd|defined}1 on the command line">;
105def err_pch_macro_def_conflict : Error<
106    "definition of macro '%0' differs between the precompiled header ('%1') "
107    "and the command line ('%2')">;
108def err_pch_undef : Error<
109    "%select{command line contains|precompiled header was built with}0 "
110    "'-undef' but %select{precompiled header was not built with it|"
111    "it is not present on the command line}0">;
112def err_pch_pp_detailed_record : Error<
113    "%select{command line contains|precompiled header was built with}0 "
114    "'-detailed-preprocessing-record' but %select{precompiled header was not "
115    "built with it|it is not present on the command line}0">;
116
117def err_module_odr_violation_missing_decl : Error<
118  "%q0 from module '%1' is not present in definition of %q2"
119  "%select{ in module '%4'| provided earlier}3">, NoSFINAE;
120def note_module_odr_violation_no_possible_decls : Note<
121  "definition has no member %0">;
122def note_module_odr_violation_possible_decl : Note<
123  "declaration of %0 does not match">;
124
125def err_module_odr_violation_different_instantiations : Error<
126  "instantiation of %q0 is different in different modules">;
127
128def warn_duplicate_module_file_extension : Warning<
129  "duplicate module file extension block name '%0'">,
130  InGroup<ModuleFileExtension>;
131
132def warn_module_system_bit_conflict : Warning<
133  "module file '%0' was validated as a system module and is now being imported "
134  "as a non-system module; any difference in diagnostic options will be ignored">,
135  InGroup<ModuleConflict>;
136
137def err_failed_to_find_module_file : Error<
138  "failed to find module file for module '%0'">;
139} // let CategoryName
140
141let CategoryName = "AST Serialization Issue" in {
142def warn_module_uses_date_time : Warning<
143  "%select{precompiled header|module}0 uses __DATE__ or __TIME__">,
144  InGroup<DiagGroup<"pch-date-time">>;
145def err_module_no_size_mtime_for_header : Error<
146  "cannot emit module %0: %select{size|mtime}1 must be explicitly specified "
147  "for missing header file \"%2\"">;
148def err_module_unable_to_hash_content : Error<
149  "failed to hash content for '%0' because memory buffer cannot be retrieved">;
150} // let CategoryName
151} // let Component
152
153