Skip to content

Commit 5a8987c

Browse files
author
Sebastian Redl
committed
Update tablegen diagnostic files to be in sync with the def files.
llvm-svn: 67004
1 parent 6c28e72 commit 5a8987c

9 files changed

+1140
-51
lines changed

clang/include/clang/Basic/Diagnostic.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ class OptionControlled;
2727
class Warning<string text> : Diagnostic<text>, OptionControlled {
2828
string DefaultMapping = "warning";
2929
}
30-
// Special cases of warnings.
31-
class Extension<string text> : Warning<text> {
32-
let DefaultMapping = "ignore";
30+
class Extension<string text> : Diagnostic<text>, OptionControlled {
31+
string DefaultMapping = "ignore";
32+
}
33+
class ExtWarn<string text> : Diagnostic<text>, OptionControlled {
34+
string DefaultMapping = "warning";
3335
}
34-
class ExtWarn<string text> : Warning<text>;
3536

3637

3738

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@
99

1010
let Component = "AST" in {
1111

12-
def note_comma_in_ice : Note<
13-
"C does not permit evaluated commas in an integer constant expression">;
12+
//def note_comma_in_ice : Note<
13+
// "C does not permit evaluated commas in an integer constant expression">;
1414
def note_expr_divide_by_zero : Note<"division by zero">;
1515

16+
// inline asm related.
17+
def err_asm_invalid_escape : Error<
18+
"invalid %% escape in inline assembly string">;
19+
def err_asm_unknown_symbolic_operand_name : Error<
20+
"unknown symbolic operand name in inline assembly string">;
21+
22+
def err_asm_unterminated_symbolic_operand_name : Error<
23+
"unterminated symbolic operand name in inline assembly string">;
24+
def err_asm_empty_symbolic_operand_name : Error<
25+
"empty symbolic operand name in inline assembly string">;
26+
def err_asm_invalid_operand_number : Error<
27+
"invalid operand number in inline asm string">;
28+
1629
}

clang/include/clang/Basic/DiagnosticAnalysisKinds.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
let Component = "Analysis" in {
1111

12+
// CHECK: use of uninitialized values
1213
def warn_uninit_val : Warning<"use of uninitialized variable">;
1314

1415
}

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==--- DiagnosticCommonKinds.td - common diagnostics --------------------===//
1+
//==--- DiagnosticCommonKinds.td - common diagnostics ---------------------===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -22,31 +22,40 @@ def note_duplicate_case_prev : Note<"previous case defined here">;
2222
def note_forward_declaration : Note<"forward declaration of %0">;
2323
def note_type_being_defined : Note<
2424
"definition of %0 is not complete until the closing '}'">;
25+
/// note_matching - this is used as a continuation of a previous diagnostic,
26+
/// e.g. to specify the '(' when we expected a ')'.
2527
def note_matching : Note<"to match this '%0'">;
28+
2629
def note_using_decl : Note<"using">;
2730
def note_also_found_decl : Note<"also found">;
2831

32+
// Parse && Lex
2933
def err_expected_colon : Error<"expected ':'">;
3034

35+
// Parse && Sema
3136
def err_no_declarators : Error<"declaration does not declare anything">;
3237
def err_param_redefinition : Error<"redefinition of parameter %0">;
3338
def err_invalid_storage_class_in_func_decl : Error<
3439
"invalid storage class specifier in function declarator">;
3540
def err_expected_namespace_name : Error<"expected namespace name">;
3641

42+
// Sema && Lex
3743
def ext_longlong : Extension<
3844
"'long long' is an extension when C99 mode is not enabled">;
3945
def warn_integer_too_large : Warning<
4046
"integer constant is too large for its type">;
4147
def warn_integer_too_large_for_signed : Warning<
4248
"integer constant is so large that it is unsigned">;
4349

50+
// Sema && AST
4451
def note_invalid_subexpr_in_ice : Note<
4552
"subexpression not valid in an integer constant expression">;
4653

54+
// Driver
4755
def pp_macro_not_used : Warning<"macro is not used">;
4856
def err_pp_I_dash_not_supported : Error<
4957
"-I- not supported, please use -iquote instead">;
50-
def warn_pp_undef_identifier : Warning<"%0 is not defined, evaluates to 0">;
58+
def warn_pp_undef_identifier : Warning<
59+
"%0 is not defined, evaluates to 0">;
5160

5261
}

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ let Component = "Driver" in {
1212
def err_drv_no_such_file : Error<"no such file or directory: '%0'">;
1313
def err_drv_unsupported_opt : Error<"unsupported option '%0'">;
1414
def err_drv_unknown_stdin_type : Error<
15-
"-E or -x required when input is from standard input">;
15+
"-E or -x required when input is from standard input">;
1616
def err_drv_unknown_language : Error<"language not recognized: '%0'">;
1717
def err_drv_invalid_opt_with_multiple_archs : Error<
18-
"option '%0' cannot be used with multiple -arch options">;
18+
"option '%0' cannot be used with multiple -arch options">;
1919
def err_drv_invalid_output_with_multiple_archs : Error<
20-
"cannot use '%0' output with multiple -arch options">;
20+
"cannot use '%0' output with multiple -arch options">;
21+
def err_drv_no_input_files : Error<"no input files">;
22+
def err_drv_use_of_Z_option : Error<
23+
"unsupported use of internal gcc -Z option '%0'">;
24+
25+
def warn_drv_input_file_unused : Warning<
26+
"%0: '%1' input file unused when '%2' is present">;
2127

2228
}

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
//===----------------------------------------------------------------------===//
99

1010
let Component = "Frontend" in {
11-
def err_fe_error_reading : Error< "error reading '%0'">;
11+
12+
def err_fe_unknown_triple : Error<
13+
"unknown target triple '%0', please use -triple or -arch">;
14+
def err_fe_error_reading : Error<"error reading '%0'">;
1215
def err_fe_error_reading_stdin : Error<"error reading stdin">;
16+
1317
}

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def escaped_newline_block_comment_end : Warning<
2222
def backslash_newline_space : Warning<
2323
"backslash and newline separated by space">;
2424

25+
// Trigraphs.
2526
def trigraph_ignored : Warning<"trigraph ignored">;
2627
def trigraph_ignored_block_comment : Warning<
2728
"ignored trigraph would end block comment">;
@@ -46,6 +47,7 @@ def err_unterminated_block_comment : Error<"unterminated /* comment">;
4647
def err_invalid_character_to_charify : Error<
4748
"invalid argument to convert to character">;
4849

50+
// Literal
4951
def ext_nonstandard_escape : Extension<
5052
"use of non-standard escape character '\\%0'">;
5153
def ext_unknown_escape : Extension<"unknown escape sequence '\\%0'">;
@@ -67,12 +69,15 @@ def err_hexconstant_requires_exponent : Error<
6769
"hexadecimal floating constants require an exponent">;
6870
def ext_hexconstant_invalid : Extension<
6971
"hexadecimal floating constants are a C99 feature">;
70-
def ext_binary_literal : Extension<"binary integer literals are an extension">;
72+
def ext_binary_literal : Extension<
73+
"binary integer literals are an extension">;
7174
def err_pascal_string_too_long : Error<"Pascal string is too long">;
7275
def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">;
7376
def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">;
7477

75-
78+
//===----------------------------------------------------------------------===//
79+
// Preprocessor Diagnostics
80+
//===----------------------------------------------------------------------===//
7681
def pp_hash_warning : Warning<"#warning%0">;
7782
def pp_include_next_in_primary : Warning<
7883
"#include_next in primary source file">;
@@ -106,7 +111,7 @@ def ext_pp_extra_tokens_at_eol : Extension<
106111
def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
107112
def ext_pp_bad_vaargs_use : Extension<
108113
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
109-
def ext_pp_macro_redef : Extension<"%0 macro redefined">;
114+
def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">;
110115
def ext_variadic_macro : Extension<"variadic macros were introduced in C99">;
111116
def ext_named_variadic_macro : Extension<
112117
"named variadic macros are a GNU extension">;

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def ext_c99_compound_literal : Extension<
4646
def ext_c99_enumerator_list_comma : Extension<
4747
"commas at the end of enumerator lists are a C99-specific feature">;
4848

49-
def ext_gnu_indirect_goto : Extension<"use of GNU indirect-goto extension">;
49+
def ext_gnu_indirect_goto : Extension<
50+
"use of GNU indirect-goto extension">;
5051
def ext_gnu_address_of_label : Extension<
5152
"use of GNU address-of-label extension">;
5253
def ext_gnu_statement_expr : Extension<
@@ -63,6 +64,7 @@ def ext_gnu_old_style_field_designator : Extension<
6364
"use of GNU old-style field designator extension">;
6465
def ext_gnu_case_range : Extension<"use of GNU case range extension">;
6566

67+
// Generic errors.
6668
def err_parse_error : Error<"parse error">;
6769
def err_expected_expression : Error<"expected expression">;
6870
def err_expected_type : Error<"expected a type">;
@@ -80,6 +82,8 @@ def err_expected_semi_decl_list : Error<
8082
"expected ';' at end of declaration list">;
8183
def ext_expected_semi_decl_list : Extension<
8284
"expected ';' at end of declaration list">;
85+
def err_expected_member_name_or_semi : Error<
86+
"expected member name or ';' after declaration specifiers">;
8387
def err_function_declared_typedef : Error<
8488
"function definition declared 'typedef'">;
8589
def err_expected_fn_body : Error<
@@ -99,6 +103,8 @@ def err_expected_semi_after : Error<"expected ';' after %0">;
99103
def err_expected_semi_after_expr : Error<"expected ';' after expression">;
100104
def err_expected_semi_after_method_proto : Error<
101105
"expected ';' after method prototype">;
106+
def err_expected_semi_after_static_assert : Error<
107+
"expected ';' after static_assert">;
102108
def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
103109
def err_expected_colon_after : Error<"expected ':' after %0">;
104110
def err_label_end_of_compound_statement : Error<
@@ -124,6 +130,7 @@ def err_expected_class_name : Error<"expected class name">;
124130
def err_unspecified_vla_size_with_static : Error<
125131
"'static' may not be used with an unspecified variable length array size">;
126132

133+
// Declarations.
127134
def err_typename_requires_specqual : Error<
128135
"type name requires a specifier or qualifier">;
129136
def err_typename_invalid_storageclass : Error<
@@ -133,6 +140,7 @@ def err_typename_invalid_functionspec : Error<
133140
def err_invalid_decl_spec_combination : Error<
134141
"cannot combine with previous '%0' declaration specifier">;
135142

143+
/// Objective-C parser diagnostics
136144
def err_objc_no_attributes_on_category : Error<
137145
"attributes may not be specified on a category">;
138146
def err_objc_missing_end : Error<"missing @end">;
@@ -146,8 +154,7 @@ def err_objc_expected_equal : Error<
146154
"setter/getter expects '=' followed by name">;
147155
def err_objc_property_requires_field_name : Error<
148156
"property requires fields to be named">;
149-
def err_objc_property_bitfield : Error<
150-
"property name cannot be a bitfield">;
157+
def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
151158
def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
152159
def err_objc_propertoes_require_objc2 : Error<
153160
"properties are an Objective-C 2 feature">;
@@ -175,6 +182,7 @@ def err_declaration_does_not_declare_param : Error<
175182
"declaration does not declare a parameter">;
176183
def err_no_matching_param : Error<"parameter named %0 is missing">;
177184

185+
/// C++ parser diagnostics
178186
def err_expected_unqualified_id : Error<"expected unqualified-id">;
179187
def err_func_def_no_params : Error<
180188
"function definition does not declare parameters">;
@@ -190,30 +198,41 @@ def ext_ellipsis_exception_spec : Extension<
190198
"exception specification of '...' is a Microsoft extension">;
191199
def err_expected_catch : Error<"expected catch">;
192200

201+
// C++ derived classes
193202
def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
194203

204+
// C++ operator overloading
195205
def err_operator_missing_type_specifier : Error<
196206
"missing type specifier after 'operator'">;
197207

208+
// Classes.
198209
def err_anon_type_definition : Error<
199210
"declaration of anonymous %0 must be a definition">;
200211

212+
213+
/// C++ Templates
201214
def err_expected_template : Error<"expected template">;
202-
def err_expected_comma_greater : Error<"expected ',' or '>' in template-parameter-list">;
215+
def err_expected_comma_greater : Error<
216+
"expected ',' or '>' in template-parameter-list">;
203217
def err_expected_type_id_after : Error<"expected type-id after '%0'">;
204218
def err_expected_class_before : Error<"expected 'class' before '%0'">;
205219
def err_template_spec_syntax_non_template : Error<
206-
"identifier followed by '<' indicates a class template specialization but %0 %select{does not refer to a template|refers to a function template|<unused>|refers to a template template parameter}1">;
220+
"identifier followed by '<' indicates a class template specialization but "
221+
"%0 %select{does not refer to a template|refers to a function "
222+
"template|<unused>|refers to a template template parameter}1">;
207223
def err_id_after_template_in_nested_name_spec : Error<
208224
"expected template name after 'template' keyword in nested name specifier">;
209225
def err_less_after_template_name_in_nested_name_spec : Error<
210226
"expected '<' after 'template %0' in nested name specifier">;
211227
def err_two_right_angle_brackets_need_space : Error<
212228
"a space is required between consecutive right angle brackets (use '> >')">;
213229
def warn_cxx0x_right_shift_in_template_arg : Warning<
214-
"use of right-shift operator ('>>') in template argument will require parentheses in C++0x">;
230+
"use of right-shift operator ('>>') in template argument will require "
231+
"parentheses in C++0x">;
215232

216233

234+
// Language specific pragmas
235+
// #pragma pack
217236
def warn_pragma_pack_expected_lparen : Warning<
218237
"missing '(' after '#pragma pack' - ignoring">;
219238
def warn_pragma_pack_expected_rparen : Warning<

0 commit comments

Comments
 (0)