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