1 | //==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===// |
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 | |
9 | let Component = "Comment" in { |
10 | let CategoryName = "Documentation Issue" in { |
11 | |
12 | // HTML parsing errors. These are under -Wdocumentation to make sure the user |
13 | // knows that we didn't parse something as they might expect. |
14 | |
15 | def warn_doc_html_start_tag_expected_quoted_string : Warning< |
16 | "expected quoted string after equals sign">, |
17 | InGroup<Documentation>, DefaultIgnore; |
18 | |
19 | def warn_doc_html_start_tag_expected_ident_or_greater : Warning< |
20 | "HTML start tag prematurely ended, expected attribute name or '>'">, |
21 | InGroup<Documentation>, DefaultIgnore; |
22 | |
23 | def note_doc_html_tag_started_here : Note< |
24 | "HTML tag started here">; |
25 | |
26 | // HTML semantic errors |
27 | |
28 | def warn_doc_html_end_forbidden : Warning< |
29 | "HTML end tag '%0' is forbidden">, |
30 | InGroup<DocumentationHTML>, DefaultIgnore; |
31 | |
32 | def warn_doc_html_end_unbalanced : Warning< |
33 | "HTML end tag does not match any start tag">, |
34 | InGroup<DocumentationHTML>, DefaultIgnore; |
35 | |
36 | def warn_doc_html_start_end_mismatch : Warning< |
37 | "HTML start tag '%0' closed by '%1'">, |
38 | InGroup<DocumentationHTML>, DefaultIgnore; |
39 | |
40 | def note_doc_html_end_tag : Note< |
41 | "end tag">; |
42 | |
43 | def warn_doc_html_missing_end_tag : Warning< |
44 | "HTML tag '%0' requires an end tag">, |
45 | InGroup<DocumentationHTML>, DefaultIgnore; |
46 | |
47 | // Commands |
48 | |
49 | def warn_doc_block_command_empty_paragraph : Warning< |
50 | "empty paragraph passed to '%select{\\|@}0%1' command">, |
51 | InGroup<Documentation>, DefaultIgnore; |
52 | |
53 | def warn_doc_block_command_duplicate : Warning< |
54 | "duplicated command '%select{\\|@}0%1'">, |
55 | InGroup<Documentation>, DefaultIgnore; |
56 | |
57 | def note_doc_block_command_previous : Note< |
58 | "previous command '%select{\\|@}0%1' here">; |
59 | |
60 | def note_doc_block_command_previous_alias : Note< |
61 | "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">; |
62 | |
63 | // \param command |
64 | |
65 | def warn_doc_param_invalid_direction : Warning< |
66 | "unrecognized parameter passing direction, " |
67 | "valid directions are '[in]', '[out]' and '[in,out]'">, |
68 | InGroup<Documentation>, DefaultIgnore; |
69 | |
70 | def warn_doc_param_spaces_in_direction : Warning< |
71 | "whitespace is not allowed in parameter passing direction">, |
72 | InGroup<DocumentationPedantic>, DefaultIgnore; |
73 | |
74 | def warn_doc_param_not_attached_to_a_function_decl : Warning< |
75 | "'%select{\\|@}0param' command used in a comment that is not attached to " |
76 | "a function declaration">, |
77 | InGroup<Documentation>, DefaultIgnore; |
78 | |
79 | def warn_doc_function_method_decl_mismatch : Warning< |
80 | "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' " |
81 | "command should be used in a comment attached to " |
82 | "%select{a function|a function|an Objective-C method|an Objective-C method|" |
83 | "a pointer to function}2 declaration">, |
84 | InGroup<Documentation>, DefaultIgnore; |
85 | |
86 | def warn_doc_api_container_decl_mismatch : Warning< |
87 | "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' " |
88 | "command should not be used in a comment attached to a " |
89 | "non-%select{class|interface|protocol|struct|union}2 declaration">, |
90 | InGroup<Documentation>, DefaultIgnore; |
91 | |
92 | def warn_doc_container_decl_mismatch : Warning< |
93 | "'%select{\\|@}0%select{classdesign|coclass|dependency|helper" |
94 | "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' " |
95 | "command should not be used in a comment attached to a non-container declaration">, |
96 | InGroup<Documentation>, DefaultIgnore; |
97 | |
98 | def warn_doc_param_duplicate : Warning< |
99 | "parameter '%0' is already documented">, |
100 | InGroup<Documentation>, DefaultIgnore; |
101 | |
102 | def note_doc_param_previous : Note< |
103 | "previous documentation">; |
104 | |
105 | def warn_doc_param_not_found : Warning< |
106 | "parameter '%0' not found in the function declaration">, |
107 | InGroup<Documentation>, DefaultIgnore; |
108 | |
109 | def note_doc_param_name_suggestion : Note< |
110 | "did you mean '%0'?">; |
111 | |
112 | // tparam command |
113 | |
114 | def warn_doc_tparam_not_attached_to_a_template_decl : Warning< |
115 | "'%select{\\|@}0tparam' command used in a comment that is not attached to " |
116 | "a template declaration">, |
117 | InGroup<Documentation>, DefaultIgnore; |
118 | |
119 | def warn_doc_tparam_duplicate : Warning< |
120 | "template parameter '%0' is already documented">, |
121 | InGroup<Documentation>, DefaultIgnore; |
122 | |
123 | def note_doc_tparam_previous : Note< |
124 | "previous documentation">; |
125 | |
126 | def warn_doc_tparam_not_found : Warning< |
127 | "template parameter '%0' not found in the template declaration">, |
128 | InGroup<Documentation>, DefaultIgnore; |
129 | |
130 | def note_doc_tparam_name_suggestion : Note< |
131 | "did you mean '%0'?">; |
132 | |
133 | // \returns command |
134 | |
135 | def warn_doc_returns_not_attached_to_a_function_decl : Warning< |
136 | "'%select{\\|@}0%1' command used in a comment that is not attached to " |
137 | "a function or method declaration">, |
138 | InGroup<Documentation>, DefaultIgnore; |
139 | |
140 | def warn_doc_returns_attached_to_a_void_function : Warning< |
141 | "'%select{\\|@}0%1' command used in a comment that is attached to a " |
142 | "%select{function returning void|constructor|destructor|" |
143 | "method returning void}2">, |
144 | InGroup<Documentation>, DefaultIgnore; |
145 | |
146 | // \deprecated command |
147 | |
148 | def warn_doc_deprecated_not_sync : Warning< |
149 | "declaration is marked with '\\deprecated' command but does not have " |
150 | "a deprecation attribute">, |
151 | InGroup<DocumentationDeprecatedSync>, DefaultIgnore; |
152 | |
153 | def note_add_deprecation_attr : Note< |
154 | "add a deprecation attribute to the declaration to silence this warning">; |
155 | |
156 | // verbatim block commands |
157 | |
158 | def warn_verbatim_block_end_without_start : Warning< |
159 | "'%select{\\|@}0%1' command does not terminate a verbatim text block">, |
160 | InGroup<Documentation>, DefaultIgnore; |
161 | |
162 | def warn_unknown_comment_command_name : Warning< |
163 | "unknown command tag name">, |
164 | InGroup<DocumentationUnknownCommand>, DefaultIgnore; |
165 | |
166 | def warn_correct_comment_command_name : Warning< |
167 | "unknown command tag name '%0'; did you mean '%1'?">, |
168 | InGroup<DocumentationUnknownCommand>, DefaultIgnore; |
169 | |
170 | } // end of documentation issue category |
171 | } // end of AST component |
172 | |