diff options
Diffstat (limited to 'tools/libclang/CXComment.cpp')
-rw-r--r-- | tools/libclang/CXComment.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp index 0fcd7c2166..57bab18546 100644 --- a/tools/libclang/CXComment.cpp +++ b/tools/libclang/CXComment.cpp @@ -411,6 +411,7 @@ struct FullCommentParts { const CommandTraits &Traits); const BlockContentComment *Brief; + const BlockContentComment *Headerfile; const ParagraphComment *FirstParagraph; const BlockCommandComment *Returns; SmallVector<const ParamCommandComment *, 8> Params; @@ -420,7 +421,7 @@ struct FullCommentParts { FullCommentParts::FullCommentParts(const FullComment *C, const CommandTraits &Traits) : - Brief(NULL), FirstParagraph(NULL), Returns(NULL) { + Brief(NULL), Headerfile(NULL), FirstParagraph(NULL), Returns(NULL) { for (Comment::child_iterator I = C->child_begin(), E = C->child_end(); I != E; ++I) { const Comment *Child = *I; @@ -448,6 +449,10 @@ FullCommentParts::FullCommentParts(const FullComment *C, Brief = BCC; break; } + if (!Headerfile && Info->IsHeaderfileCommand) { + Headerfile = BCC; + break; + } if (!Returns && Info->IsReturnsCommand) { Returns = BCC; break; @@ -750,6 +755,8 @@ void CommentASTToHTMLConverter::visitFullComment(const FullComment *C) { FullCommentParts Parts(C, Traits); bool FirstParagraphIsBrief = false; + if (Parts.Headerfile) + visit(Parts.Headerfile); if (Parts.Brief) visit(Parts.Brief); else if (Parts.FirstParagraph) { @@ -1202,6 +1209,12 @@ void CommentASTToXMLConverter::visitFullComment(const FullComment *C) { RootEndTag = "</Other>"; Result << "<Other><Name>unknown</Name>"; } + + if (Parts.Headerfile) { + Result << "<Headerfile>"; + visit(Parts.Headerfile); + Result << "</Headerfile>"; + } { // Pretty-print the declaration. @@ -1225,7 +1238,7 @@ void CommentASTToXMLConverter::visitFullComment(const FullComment *C) { Result << "</Abstract>"; FirstParagraphIsBrief = true; } - + if (Parts.TParams.size() != 0) { Result << "<TemplateParameters>"; for (unsigned i = 0, e = Parts.TParams.size(); i != e; ++i) |