summaryrefslogtreecommitdiff
path: root/lib/AST/CommentSema.cpp
Commit message (Collapse)AuthorAge
...
* Comment parser and sema: remove useless return valuesDmitri Gribenko2012-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161331 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment diagnostics: warn on duplicate \brief and \return commands.Dmitri Gribenko2012-08-06
| | | | | | | | | | | Doxygen manual claims that multiple \brief or \returns commands will be merged together, but actual behavior is different (second \brief command becomes a part of a discussion, second \returns becomes a "Returns: blah" paragraph on its own). Anyway, it seems to be a bad idea to use multiple \brief or \returns commands in a single command. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161325 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment diagnostics: \return in void function: specialize diagnostic text forDmitri Gribenko2012-08-06
| | | | | | | ObjC methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161324 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment diagnostics: warn if \returns is used in a non-function comment or ifDmitri Gribenko2012-08-03
| | | | | | | the function returns void. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161261 91177308-0d34-0410-b5e6-96231b3b80d8
* Comments AST: refactor DeclInfo to use an enum for decl kind instead ofDmitri Gribenko2012-08-02
| | | | | | | separate flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161217 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize flag in DeclInfo.Dmitri Gribenko2012-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161141 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment AST: add DeclInfo to store information about the declaration. Sema wasDmitri Gribenko2012-08-01
| | | | | | | already extracting most of this, but discarding at the end of semantic analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161140 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-31
| | | | | | | | | | | The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this breaks libclang binary compatibility, but should not be a problem since API is so new. This also fixes PR13372 as a side-effect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161087 91177308-0d34-0410-b5e6-96231b3b80d8
* CommentSema.cpp: remove extra semicolonDmitri Gribenko2012-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160901 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment Sema: don't try to typo-correct a \param when function has zeroDmitri Gribenko2012-07-27
| | | | | | | arguments. Just an optimization, no functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160896 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment diagnostics: add warning for multiple \param commands with duplicateDmitri Gribenko2012-07-24
| | | | | | | parameter names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160696 91177308-0d34-0410-b5e6-96231b3b80d8
* CommentSema: simplify functions, per Jordan's comment.Dmitri Gribenko2012-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160689 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment Sema: refactor handling of 'ParmVarDecl's and save them in Sema members.Dmitri Gribenko2012-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160634 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment AST: add InlineContentComment::RenderKind to specify a defaultDmitri Gribenko2012-07-23
| | | | | | | | | rendering mode for clients that don't want to interpret Doxygen commands. Also add a libclang API to query this information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160633 91177308-0d34-0410-b5e6-96231b3b80d8
* CommentSema: add more inline commands to tablesDmitri Gribenko2012-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160481 91177308-0d34-0410-b5e6-96231b3b80d8
* CommentSema: \short is the same as \brief.Dmitri Gribenko2012-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160414 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in ↵Dmitri Gribenko2012-07-13
| | | | | | line with Statement AST nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160182 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML ↵Dmitri Gribenko2012-07-13
| | | | | | start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160153 91177308-0d34-0410-b5e6-96231b3b80d8
* Make concepts of optional and forbidden end tags separate. Thanks Jordan ↵Dmitri Gribenko2012-07-12
| | | | | | for pointing this! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160149 91177308-0d34-0410-b5e6-96231b3b80d8
* AST/CommentSema.cpp: Fix signess in abs() to appease msvc. It would not make ↵NAKAMURA Takumi2012-07-12
| | | | | | sense to pass (unsigned)-(unsigned) to abs(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160097 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warning.Richard Smith2012-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160087 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160078 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-06
very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8