1 //==--- DiagnosticSerializationKinds.td - serialization diagnostics -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 let Component = "Serialization" in {
11 let CategoryName = "AST Deserialization Issue" in {
13 def err_fe_unable_to_read_pch_file : Error<
14 "unable to read PCH file %0: '%1'">;
15 def err_fe_not_a_pch_file : Error<
16 "input is not a PCH file: '%0'">;
17 def err_fe_pch_malformed : Error<
18 "malformed or corrupted AST file: '%0'">, DefaultFatal;
19 def err_fe_pch_malformed_block : Error<
20 "malformed block record in PCH file: '%0'">, DefaultFatal;
21 def err_fe_pch_file_modified : Error<
22 "file '%0' has been modified since the precompiled header '%1' was built">,
24 def err_fe_module_file_modified : Error<
25 "file '%0' has been modified since the module file '%1' was built">,
27 def err_fe_ast_file_modified : Error<
28 "file '%0' has been modified since the AST file '%1' was built">,
30 def err_fe_pch_file_overridden : Error<
31 "file '%0' from the precompiled header has been overridden">;
32 def note_pch_required_by : Note<"'%0' required by '%1'">;
33 def note_pch_rebuild_required : Note<"please rebuild precompiled header '%0'">;
34 def note_module_cache_path : Note<
35 "after modifying system headers, please delete the module cache at '%0'">;
37 def err_pch_targetopt_mismatch : Error<
38 "PCH file was compiled for the %0 '%1' but the current translation "
39 "unit is being compiled for target '%2'">;
40 def err_pch_targetopt_feature_mismatch : Error<
41 "%select{AST file|current translation unit}0 was compiled with the target "
42 "feature'%1' but the %select{current translation unit is|AST file was}0 "
44 def err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in "
45 "PCH file but is currently %select{disabled|enabled}2">;
46 def err_pch_langopt_value_mismatch : Error<
47 "%0 differs in PCH file vs. current file">;
48 def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
50 def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache "
51 "path '%0', but the path is currently '%1'">;
53 def err_pch_version_too_old : Error<
54 "PCH file uses an older PCH format that is no longer supported">;
55 def err_pch_version_too_new : Error<
56 "PCH file uses a newer PCH format that cannot be read">;
57 def err_pch_different_branch : Error<
58 "PCH file built from a different branch (%0) than the compiler (%1)">;
59 def err_pch_with_compiler_errors : Error<
60 "PCH file contains compiler errors">;
62 def err_module_file_conflict : Error<
63 "module '%0' is defined in both '%1' and '%2'">, DefaultFatal;
64 def err_module_file_not_found : Error<
65 "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
66 def err_module_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;
69 def err_module_file_invalid : Error<
70 "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, DefaultFatal;
71 def note_module_file_imported_by : Note<
72 "imported by %select{|module '%2' in }1'%0'">;
73 def err_module_file_not_module : Error<
74 "AST file '%0' was not built as a module">, DefaultFatal;
76 def err_imported_module_not_found : Error<
77 "module '%0' in AST file '%1' (imported by AST file '%2') "
78 "is not defined in any loaded module map file; "
79 "maybe you need to load '%3'?">, DefaultFatal;
80 def err_imported_module_modmap_changed : Error<
81 "module '%0' imported by AST file '%1' found in a different module map file"
82 " (%2) than when the importing AST file was built (%3)">, DefaultFatal;
83 def err_imported_module_relocated : Error<
84 "module '%0' was built in directory '%1' but now resides in "
85 "directory '%2'">, DefaultFatal;
86 def err_module_different_modmap : Error<
87 "module '%0' %select{uses|does not use}1 additional module map '%2'"
88 "%select{| not}1 used when the module was built">;
90 def err_pch_macro_def_undef : Error<
91 "macro '%0' was %select{defined|undef'd}1 in the precompiled header but "
92 "%select{undef'd|defined}1 on the command line">;
93 def err_pch_macro_def_conflict : Error<
94 "definition of macro '%0' differs between the precompiled header ('%1') "
95 "and the command line ('%2')">;
96 def err_pch_undef : Error<
97 "%select{command line contains|precompiled header was built with}0 "
98 "'-undef' but %select{precompiled header was not built with it|"
99 "it is not present on the command line}0">;
100 def err_pch_pp_detailed_record : Error<
101 "%select{command line contains|precompiled header was built with}0 "
102 "'-detailed-preprocessing-record' but %select{precompiled header was not "
103 "built with it|it is not present on the command line}0">;
105 def err_module_odr_violation_missing_decl : Error<
106 "%q0 from module '%1' is not present in definition of %q2"
107 "%select{ in module '%4'| provided earlier}3">, NoSFINAE;
108 def note_module_odr_violation_no_possible_decls : Note<
109 "definition has no member %0">;
110 def note_module_odr_violation_possible_decl : Note<
111 "declaration of %0 does not match">;
112 def err_module_odr_violation_different_definitions : Error<
113 "%q0 has different definitions in different modules; "
114 "%select{definition in module '%2' is here|defined here}1">;
115 def note_module_odr_violation_different_definitions : Note<
116 "definition in module '%0' is here">;
117 def err_module_odr_violation_different_instantiations : Error<
118 "instantiation of %q0 is different in different modules">;
120 def err_module_odr_violation_mismatch_decl : Error<
121 "%q0 has different definitions in different modules; first difference is "
122 "%select{definition in module '%2'|defined here}1 found "
123 "%select{end of class|public access specifier|private access specifier|"
124 "protected access specifier|static assert|field|method|type alias|typedef|"
126 def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found "
127 "%select{end of class|public access specifier|private access specifier|"
128 "protected access specifier|static assert|field|method|type alias|typedef|"
131 def err_module_odr_violation_mismatch_decl_diff : Error<
132 "%q0 has different definitions in different modules; first difference is "
133 "%select{definition in module '%2'|defined here}1 found "
135 "static assert with condition|"
136 "static assert with message|"
137 "static assert with %select{|no }4message|"
139 "field %4 with type %5|"
140 "%select{non-|}5bitfield %4|"
141 "bitfield %4 with one width expression|"
142 "%select{non-|}5mutable field %4|"
143 "field %4 with %select{no|an}5 initalizer|"
144 "field %4 with an initializer|"
146 "method %4 is %select{not deleted|deleted}5|"
147 "method %4 is %select{|pure }5%select{not virtual|virtual}6|"
148 "method %4 is %select{not static|static}5|"
149 "method %4 is %select{not volatile|volatile}5|"
150 "method %4 is %select{not const|const}5|"
151 "method %4 is %select{not inline|inline}5|"
152 "method %4 that has %5 parameter%s5|"
153 "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|"
154 "method %4 with %ordinal5 parameter named %6|"
155 "method %4 with %ordinal5 parameter with%select{out|}6 a default argument|"
156 "method %4 with %ordinal5 parameter with a default argument|"
157 "%select{typedef|type alias}4 name %5|"
158 "%select{typedef|type alias}4 %5 with underlying type %6|"
159 "data member with name %4|"
160 "data member %4 with type %5|"
161 "data member %4 with%select{out|}5 an initializer|"
162 "data member %4 with an initializer|"
163 "data member %4 %select{is constexpr|is not constexpr}5|"
166 def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found "
168 "static assert with different condition|"
169 "static assert with different message|"
170 "static assert with %select{|no }2message|"
172 "field %2 with type %3|"
173 "%select{non-|}3bitfield %2|"
174 "bitfield %2 with different width expression|"
175 "%select{non-|}3mutable field %2|"
176 "field %2 with %select{no|an}3 initializer|"
177 "field %2 with a different initializer|"
179 "method %2 is %select{not deleted|deleted}3|"
180 "method %2 is %select{|pure }3%select{not virtual|virtual}4|"
181 "method %2 is %select{not static|static}3|"
182 "method %2 is %select{not volatile|volatile}3|"
183 "method %2 is %select{not const|const}3|"
184 "method %2 is %select{not inline|inline}3|"
185 "method %2 that has %3 parameter%s3|"
186 "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|"
187 "method %2 with %ordinal3 parameter named %4|"
188 "method %2 with %ordinal3 parameter with%select{out|}4 a default argument|"
189 "method %2 with %ordinal3 parameter with a different default argument|"
190 "%select{typedef|type alias}2 name %3|"
191 "%select{typedef|type alias}2 %3 with different underlying type %4|"
192 "data member with name %2|"
193 "data member %2 with different type %3|"
194 "data member %2 with%select{out|}3 an initializer|"
195 "data member %2 with a different initializer|"
196 "data member %2 %select{is constexpr|is not constexpr}3|"
199 def err_module_odr_violation_mismatch_decl_unknown : Error<
200 "%q0 %select{with definition in module '%2'|defined here}1 has different "
201 "definitions in different modules; first difference is this "
202 "%select{||||static assert|field|method|type alias|typedef|data member|"
203 "unexpected decl}3">;
204 def note_module_odr_violation_mismatch_decl_unknown : Note<
206 "%select{||||different static assert|different field|different method|"
207 "different type alias|different typedef|different data member|"
208 "another unexpected decl}1">;
210 def warn_duplicate_module_file_extension : Warning<
211 "duplicate module file extension block name '%0'">,
212 InGroup<ModuleFileExtension>;
214 def warn_module_system_bit_conflict : Warning<
215 "module file '%0' was validated as a system module and is now being imported "
216 "as a non-system module; any difference in diagnostic options will be ignored">,
217 InGroup<ModuleConflict>;
218 } // let CategoryName
220 let CategoryName = "AST Serialization Issue" in {
221 def warn_module_uses_date_time : Warning<
222 "%select{precompiled header|module}0 uses __DATE__ or __TIME__">,
223 InGroup<DiagGroup<"pch-date-time">>;
224 def err_module_no_size_mtime_for_header : Error<
225 "cannot emit module %0: %select{size|mtime}1 must be explicitly specified "
226 "for missing header file \"%2\"">;
227 } // let CategoryName