aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-05-03 23:15:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-05-03 23:15:20 +0000
commitad6fd9f93ce0d328397e8d57ef7117ced24fc8e2 (patch)
treeff65aa9339d215a60b3a59212e7795cc6fcec093 /include
parentcc2b653c319599f502425d2c3de29865d47bb9e4 (diff)
[Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/CommentLexer.h10
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td6
2 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h
index 4179f45e80..f152c778c9 100644
--- a/include/clang/AST/CommentLexer.h
+++ b/include/clang/AST/CommentLexer.h
@@ -15,6 +15,7 @@
#define LLVM_CLANG_AST_COMMENT_LEXER_H
#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/Diagnostic.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@@ -227,6 +228,8 @@ private:
/// computed (for example, resolved decimal character references).
llvm::BumpPtrAllocator &Allocator;
+ DiagnosticsEngine &Diags;
+
const CommandTraits &Traits;
const char *const BufferStart;
@@ -316,6 +319,10 @@ private:
return FileLoc.getLocWithOffset(CharNo);
}
+ DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) {
+ return Diags.Report(Loc, DiagID);
+ }
+
/// Eat string matching regexp \code \s*\* \endcode.
void skipLineStartingDecorations();
@@ -346,7 +353,8 @@ private:
void lexHTMLEndTag(Token &T);
public:
- Lexer(llvm::BumpPtrAllocator &Allocator, const CommandTraits &Traits,
+ Lexer(llvm::BumpPtrAllocator &Allocator, DiagnosticsEngine &Diags,
+ const CommandTraits &Traits,
SourceLocation FileLoc,
const char *BufferStart, const char *BufferEnd);
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index 548823f1f0..fb0ab3c1a4 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -27,6 +27,10 @@ def backslash_newline_space : Warning<
"backslash and newline separated by space">,
InGroup<DiagGroup<"backslash-newline-escape">>;
+// comment parsing
+def warn_unknown_comment_command_name : Warning<
+ "unknown command tag name">, InGroup<DiagGroup<"comment-command-tag">>;
+
// Digraphs.
def warn_cxx98_compat_less_colon_colon : Warning<
"'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">,
@@ -586,4 +590,4 @@ def warn_uncovered_module_header : Warning<
def err_expected_id_building_module : Error<
"expected a module name in '__building_module' expression">;
-}
+} \ No newline at end of file