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