Index: bindings/xml/comment-xml-schema.rng
===================================================================
--- bindings/xml/comment-xml-schema.rng (revision 174114)
+++ bindings/xml/comment-xml-schema.rng (working copy)
@@ -45,6 +45,9 @@
+
+
+
@@ -106,6 +109,9 @@
+
+
+
@@ -147,10 +153,12 @@
-
+
+
+
@@ -187,6 +195,9 @@
+
+
+
@@ -223,6 +234,9 @@
+
+
+
@@ -259,6 +273,9 @@
+
+
+
@@ -295,6 +312,9 @@
+
+
+
@@ -366,6 +386,14 @@
+
+
+
+
+
+
+
+
Index: include/clang/AST/CommentCommandTraits.h
===================================================================
--- include/clang/AST/CommentCommandTraits.h (revision 174114)
+++ include/clang/AST/CommentCommandTraits.h (working copy)
@@ -71,6 +71,9 @@
/// \brief True if this is a \\headerfile-like command.
unsigned IsHeaderfileCommand : 1;
+
+ /// \brief True if this is a \\todo-like command.
+ unsigned IsTodoCommand : 1;
/// True if we don't want to warn about this command being passed an empty
/// paragraph. Meaningful only for block commands.
Index: include/clang/AST/CommentCommands.td
===================================================================
--- include/clang/AST/CommentCommands.td (revision 174114)
+++ include/clang/AST/CommentCommands.td (working copy)
@@ -17,6 +17,7 @@
bit IsTParamCommand = 0;
bit IsDeprecatedCommand = 0;
bit IsHeaderfileCommand = 0;
+ bit IsTodoCommand = 0;
bit IsEmptyParagraphAllowed = 0;
@@ -95,6 +96,7 @@
}
def Headerfile : BlockCommand<"headerfile"> { let IsHeaderfileCommand = 1; }
+def Todo : BlockCommand<"todo"> { let IsTodoCommand = 1; }
// We don't do any additional semantic analysis for the following
// BlockCommands. It might be a good idea to do something extra for them, but
@@ -114,7 +116,6 @@
def Sa : BlockCommand<"sa">;
def See : BlockCommand<"see">;
def Since : BlockCommand<"since">;
-def Todo : BlockCommand<"todo">;
def Version : BlockCommand<"version">;
def Warning : BlockCommand<"warning">;
Index: include/clang/AST/CommentSema.h
===================================================================
--- include/clang/AST/CommentSema.h (revision 174114)
+++ include/clang/AST/CommentSema.h (working copy)
@@ -63,6 +63,9 @@
/// AST node for the \\headerfile command.
const BlockCommandComment *HeaderfileCommand;
+
+ /// AST node for the \\todo command.
+ const BlockCommandComment *TodoCommand;
DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) {
return Diags.Report(Loc, DiagID);
Index: lib/AST/CommentSema.cpp
===================================================================
--- lib/AST/CommentSema.cpp (revision 174114)
+++ lib/AST/CommentSema.cpp (working copy)
@@ -30,7 +30,7 @@
const Preprocessor *PP) :
Allocator(Allocator), SourceMgr(SourceMgr), Diags(Diags), Traits(Traits),
PP(PP), ThisDeclInfo(NULL), BriefCommand(NULL), ReturnsCommand(NULL),
- HeaderfileCommand(NULL) {
+ HeaderfileCommand(NULL), TodoCommand(NULL) {
}
void Sema::setDecl(const Decl *D) {
@@ -492,6 +492,12 @@
return;
}
PrevCommand = HeaderfileCommand;
+ } else if (Info->IsTodoCommand) {
+ if (!TodoCommand) {
+ TodoCommand = Command;
+ return;
+ }
+ PrevCommand = TodoCommand;
} else {
// We don't want to check this command for duplicates.
return;
Index: tools/libclang/CXComment.cpp
===================================================================
--- tools/libclang/CXComment.cpp (revision 174114)
+++ tools/libclang/CXComment.cpp (working copy)
@@ -412,6 +412,7 @@
const BlockContentComment *Brief;
const BlockContentComment *Headerfile;
+ const BlockContentComment *Todo;
const ParagraphComment *FirstParagraph;
const BlockCommandComment *Returns;
SmallVector Params;
@@ -421,7 +422,8 @@
FullCommentParts::FullCommentParts(const FullComment *C,
const CommandTraits &Traits) :
- Brief(NULL), Headerfile(NULL), FirstParagraph(NULL), Returns(NULL) {
+ Brief(NULL), Headerfile(NULL), Todo(NULL), FirstParagraph(NULL),
+ Returns(NULL) {
for (Comment::child_iterator I = C->child_begin(), E = C->child_end();
I != E; ++I) {
const Comment *Child = *I;
@@ -453,6 +455,10 @@
Headerfile = BCC;
break;
}
+ if (!Todo && Info->IsTodoCommand) {
+ Todo = BCC;
+ break;
+ }
if (!Returns && Info->IsReturnsCommand) {
Returns = BCC;
break;
@@ -789,6 +795,9 @@
if (Parts.Returns)
visit(Parts.Returns);
+
+ if (Parts.Todo)
+ visit(Parts.Todo);
Result.flush();
}
@@ -1324,7 +1333,7 @@
Result << "";
}
}
-
+
{
bool StartTagEmitted = false;
for (unsigned i = 0, e = Parts.MiscBlocks.size(); i != e; ++i) {
@@ -1341,6 +1350,12 @@
Result << "";
}
+ if (Parts.Todo) {
+ Result << "";
+ visit(Parts.Todo);
+ Result << "";
+ }
+
Result << RootEndTag;
Result.flush();
Index: utils/TableGen/ClangCommentCommandInfoEmitter.cpp
===================================================================
--- utils/TableGen/ClangCommentCommandInfoEmitter.cpp (revision 174114)
+++ utils/TableGen/ClangCommentCommandInfoEmitter.cpp (working copy)
@@ -42,6 +42,7 @@
<< Tag.getValueAsBit("IsTParamCommand") << ", "
<< Tag.getValueAsBit("IsDeprecatedCommand") << ", "
<< Tag.getValueAsBit("IsHeaderfileCommand") << ", "
+ << Tag.getValueAsBit("IsTodoCommand") << ", "
<< Tag.getValueAsBit("IsEmptyParagraphAllowed") << ", "
<< Tag.getValueAsBit("IsVerbatimBlockCommand") << ", "
<< Tag.getValueAsBit("IsVerbatimBlockEndCommand") << ", "