llvm-project/clang/tools/diagtool
Dmitri Gribenko f26054f0fb Enable comment parsing and semantic analysis to emit diagnostics. A few
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).

llvm-svn: 160078
2012-07-11 21:38:39 +00:00
..
CMakeLists.txt [diagtool] Add a new "tree" command to shows warnings activated by a flag. 2012-06-24 00:07:45 +00:00
DiagTool.cpp The diagtool registration system tries to use a global variable from a method 2011-08-12 01:14:22 +00:00
DiagTool.h The diagtool registration system tries to use a global variable from a method 2011-08-12 01:14:22 +00:00
DiagnosticNames.cpp Enable comment parsing and semantic analysis to emit diagnostics. A few 2012-07-11 21:38:39 +00:00
DiagnosticNames.h [diagtool] Add a new "tree" command to shows warnings activated by a flag. 2012-06-24 00:07:45 +00:00
ListWarnings.cpp Enhance 'diagtool list-warnings' to report number of diagnostics covered directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow. 2012-07-07 06:30:31 +00:00
Makefile Fix a big layering violation introduced by r158771. 2012-06-20 09:53:52 +00:00
ShowEnabledWarnings.cpp [diagtool] Add a new "tree" command to shows warnings activated by a flag. 2012-06-24 00:07:45 +00:00
TreeView.cpp [diagtool] Add a new "tree" command to shows warnings activated by a flag. 2012-06-24 00:07:45 +00:00
diagtool_main.cpp [diagtool] Write to llvm::outs() by default instead of llvm::errs() 2012-06-22 00:33:20 +00:00