[cfe-commits] r172409 - in /cfe/trunk: lib/AST/ASTDumper.cpp lib/AST/CMakeLists.txt lib/AST/Comment.cpp lib/AST/CommentDumper.cpp test/Misc/ast-dump-comment.cpp
Alexander Kornienko
alexfh at google.com
Mon Jan 14 06:07:12 PST 2013
Author: alexfh
Date: Mon Jan 14 08:07:11 2013
New Revision: 172409
URL: http://llvm.org/viewvc/llvm-project?rev=172409&view=rev
Log:
Dump comments in -ast-dump.
http://llvm-reviews.chandlerc.com/D269
"Added dumping of declaration comments in ASTDumper. This required moving the
comment dumping code from CommentDumper so that the indentation is correct."
Patch by Philip Craig!
Added:
cfe/trunk/test/Misc/ast-dump-comment.cpp
Removed:
cfe/trunk/lib/AST/CommentDumper.cpp
Modified:
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/lib/AST/CMakeLists.txt
cfe/trunk/lib/AST/Comment.cpp
Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=172409&r1=172408&r2=172409&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Mon Jan 14 08:07:11 2013
@@ -14,6 +14,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
+#include "clang/AST/CommentVisitor.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclVisitor.h"
@@ -22,6 +23,7 @@
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
+using namespace clang::comments;
//===----------------------------------------------------------------------===//
// ASTDumper Visitor
@@ -29,9 +31,11 @@
namespace {
class ASTDumper
- : public DeclVisitor<ASTDumper>, public StmtVisitor<ASTDumper> {
- SourceManager *SM;
+ : public DeclVisitor<ASTDumper>, public StmtVisitor<ASTDumper>,
+ public ConstCommentVisitor<ASTDumper> {
raw_ostream &OS;
+ const CommandTraits *Traits;
+ const SourceManager *SM;
unsigned IndentLevel;
bool IsFirstLine;
@@ -40,6 +44,9 @@
const char *LastLocFilename;
unsigned LastLocLine;
+ /// The \c FullComment parent of the comment being dumped.
+ const FullComment *FC;
+
class IndentScope {
ASTDumper &Dumper;
public:
@@ -52,9 +59,10 @@
};
public:
- ASTDumper(SourceManager *SM, raw_ostream &OS)
- : SM(SM), OS(OS), IndentLevel(0), IsFirstLine(true),
- LastLocFilename(""), LastLocLine(~0U) { }
+ ASTDumper(raw_ostream &OS, const CommandTraits *Traits,
+ const SourceManager *SM)
+ : OS(OS), Traits(Traits), SM(SM), IndentLevel(0), IsFirstLine(true),
+ LastLocFilename(""), LastLocLine(~0U), FC(0) { }
~ASTDumper() {
OS << "\n";
@@ -62,6 +70,7 @@
void dumpDecl(Decl *D);
void dumpStmt(Stmt *S);
+ void dumpFullComment(const FullComment *C);
// Utilities
void indent();
@@ -188,6 +197,24 @@
void VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *Node);
void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node);
void VisitObjCBoolLiteralExpr(ObjCBoolLiteralExpr *Node);
+
+ // Comments.
+ const char *getCommandName(unsigned CommandID);
+ void dumpComment(const Comment *C);
+
+ // Inline comments.
+ void visitTextComment(const TextComment *C);
+ void visitInlineCommandComment(const InlineCommandComment *C);
+ void visitHTMLStartTagComment(const HTMLStartTagComment *C);
+ void visitHTMLEndTagComment(const HTMLEndTagComment *C);
+
+ // Block comments.
+ void visitBlockCommandComment(const BlockCommandComment *C);
+ void visitParamCommandComment(const ParamCommandComment *C);
+ void visitTParamCommandComment(const TParamCommandComment *C);
+ void visitVerbatimBlockComment(const VerbatimBlockComment *C);
+ void visitVerbatimBlockLineComment(const VerbatimBlockLineComment *C);
+ void visitVerbatimLineComment(const VerbatimLineComment *C);
};
}
@@ -446,6 +473,7 @@
E = D->getAttrs().end(); I != E; ++I)
dumpAttr(*I);
}
+ dumpFullComment(D->getASTContext().getCommentForDecl(D, 0));
// Decls within functions are visited by the body
if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D))
dumpDeclContext(dyn_cast<DeclContext>(D));
@@ -1376,6 +1404,145 @@
}
//===----------------------------------------------------------------------===//
+// Comments
+//===----------------------------------------------------------------------===//
+
+const char *ASTDumper::getCommandName(unsigned CommandID) {
+ if (Traits)
+ return Traits->getCommandInfo(CommandID)->Name;
+ const CommandInfo *Info = CommandTraits::getBuiltinCommandInfo(CommandID);
+ if (Info)
+ return Info->Name;
+ return "<not a builtin command>";
+}
+
+void ASTDumper::dumpFullComment(const FullComment *C) {
+ if (!C)
+ return;
+
+ FC = C;
+ dumpComment(C);
+ FC = 0;
+}
+
+void ASTDumper::dumpComment(const Comment *C) {
+ IndentScope Indent(*this);
+
+ if (!C) {
+ OS << "<<<NULL>>>";
+ return;
+ }
+
+ OS << C->getCommentKindName();
+ dumpPointer(C);
+ dumpSourceRange(C->getSourceRange());
+ ConstCommentVisitor<ASTDumper>::visit(C);
+ for (Comment::child_iterator I = C->child_begin(), E = C->child_end();
+ I != E; ++I)
+ dumpComment(*I);
+}
+
+void ASTDumper::visitTextComment(const TextComment *C) {
+ OS << " Text=\"" << C->getText() << "\"";
+}
+
+void ASTDumper::visitInlineCommandComment(const InlineCommandComment *C) {
+ OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
+ switch (C->getRenderKind()) {
+ case InlineCommandComment::RenderNormal:
+ OS << " RenderNormal";
+ break;
+ case InlineCommandComment::RenderBold:
+ OS << " RenderBold";
+ break;
+ case InlineCommandComment::RenderMonospaced:
+ OS << " RenderMonospaced";
+ break;
+ case InlineCommandComment::RenderEmphasized:
+ OS << " RenderEmphasized";
+ break;
+ }
+
+ for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
+ OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
+}
+
+void ASTDumper::visitHTMLStartTagComment(const HTMLStartTagComment *C) {
+ OS << " Name=\"" << C->getTagName() << "\"";
+ if (C->getNumAttrs() != 0) {
+ OS << " Attrs: ";
+ for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
+ const HTMLStartTagComment::Attribute &Attr = C->getAttr(i);
+ OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
+ }
+ }
+ if (C->isSelfClosing())
+ OS << " SelfClosing";
+}
+
+void ASTDumper::visitHTMLEndTagComment(const HTMLEndTagComment *C) {
+ OS << " Name=\"" << C->getTagName() << "\"";
+}
+
+void ASTDumper::visitBlockCommandComment(const BlockCommandComment *C) {
+ OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
+ for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
+ OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
+}
+
+void ASTDumper::visitParamCommandComment(const ParamCommandComment *C) {
+ OS << " " << ParamCommandComment::getDirectionAsString(C->getDirection());
+
+ if (C->isDirectionExplicit())
+ OS << " explicitly";
+ else
+ OS << " implicitly";
+
+ if (C->hasParamName()) {
+ if (C->isParamIndexValid())
+ OS << " Param=\"" << C->getParamName(FC) << "\"";
+ else
+ OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
+ }
+
+ if (C->isParamIndexValid())
+ OS << " ParamIndex=" << C->getParamIndex();
+}
+
+void ASTDumper::visitTParamCommandComment(const TParamCommandComment *C) {
+ if (C->hasParamName()) {
+ if (C->isPositionValid())
+ OS << " Param=\"" << C->getParamName(FC) << "\"";
+ else
+ OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
+ }
+
+ if (C->isPositionValid()) {
+ OS << " Position=<";
+ for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
+ OS << C->getIndex(i);
+ if (i != e - 1)
+ OS << ", ";
+ }
+ OS << ">";
+ }
+}
+
+void ASTDumper::visitVerbatimBlockComment(const VerbatimBlockComment *C) {
+ OS << " Name=\"" << getCommandName(C->getCommandID()) << "\""
+ " CloseName=\"" << C->getCloseName() << "\"";
+}
+
+void ASTDumper::visitVerbatimBlockLineComment(
+ const VerbatimBlockLineComment *C) {
+ OS << " Text=\"" << C->getText() << "\"";
+}
+
+void ASTDumper::visitVerbatimLineComment(const VerbatimLineComment *C) {
+ OS << " Text=\"" << C->getText() << "\"";
+}
+
+//===----------------------------------------------------------------------===//
// Decl method implementations
//===----------------------------------------------------------------------===//
@@ -1384,7 +1551,8 @@
}
void Decl::dump(raw_ostream &OS) const {
- ASTDumper P(&getASTContext().getSourceManager(), OS);
+ ASTDumper P(OS, &getASTContext().getCommentCommandTraits(),
+ &getASTContext().getSourceManager());
P.dumpDecl(const_cast<Decl*>(this));
}
@@ -1397,11 +1565,31 @@
}
void Stmt::dump(raw_ostream &OS, SourceManager &SM) const {
- ASTDumper P(&SM, OS);
+ ASTDumper P(OS, 0, &SM);
P.dumpStmt(const_cast<Stmt*>(this));
}
void Stmt::dump() const {
- ASTDumper P(0, llvm::errs());
+ ASTDumper P(llvm::errs(), 0, 0);
P.dumpStmt(const_cast<Stmt*>(this));
}
+
+//===----------------------------------------------------------------------===//
+// Comment method implementations
+//===----------------------------------------------------------------------===//
+
+void Comment::dump() const {
+ dump(llvm::errs(), 0, 0);
+}
+
+void Comment::dump(const ASTContext &Context) const {
+ dump(llvm::errs(), &Context.getCommentCommandTraits(),
+ &Context.getSourceManager());
+}
+
+void Comment::dump(llvm::raw_ostream &OS, const CommandTraits *Traits,
+ const SourceManager *SM) const {
+ const FullComment *FC = dyn_cast<FullComment>(this);
+ ASTDumper D(OS, Traits, SM);
+ D.dumpFullComment(FC);
+}
Modified: cfe/trunk/lib/AST/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CMakeLists.txt?rev=172409&r1=172408&r2=172409&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CMakeLists.txt (original)
+++ cfe/trunk/lib/AST/CMakeLists.txt Mon Jan 14 08:07:11 2013
@@ -12,7 +12,6 @@
Comment.cpp
CommentBriefParser.cpp
CommentCommandTraits.cpp
- CommentDumper.cpp
CommentLexer.cpp
CommentParser.cpp
CommentSema.cpp
Modified: cfe/trunk/lib/AST/Comment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=172409&r1=172408&r2=172409&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Comment.cpp (original)
+++ cfe/trunk/lib/AST/Comment.cpp Mon Jan 14 08:07:11 2013
@@ -32,20 +32,6 @@
llvm_unreachable("Unknown comment kind!");
}
-void Comment::dump() const {
- // It is important that Comment::dump() is defined in a different TU than
- // Comment::dump(raw_ostream, SourceManager). If both functions were defined
- // in CommentDumper.cpp, that object file would be removed by linker because
- // none of its functions are referenced by other object files, despite the
- // LLVM_ATTRIBUTE_USED.
- dump(llvm::errs(), NULL, NULL);
-}
-
-void Comment::dump(const ASTContext &Context) const {
- dump(llvm::errs(), &Context.getCommentCommandTraits(),
- &Context.getSourceManager());
-}
-
namespace {
struct good {};
struct bad {};
Removed: cfe/trunk/lib/AST/CommentDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentDumper.cpp?rev=172408&view=auto
==============================================================================
--- cfe/trunk/lib/AST/CommentDumper.cpp (original)
+++ cfe/trunk/lib/AST/CommentDumper.cpp (removed)
@@ -1,257 +0,0 @@
-//===--- CommentDumper.cpp - Dumping implementation for Comment ASTs ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/AST/CommentVisitor.h"
-#include "llvm/Support/raw_ostream.h"
-
-namespace clang {
-namespace comments {
-
-namespace {
-class CommentDumper: public comments::ConstCommentVisitor<CommentDumper> {
- raw_ostream &OS;
- const CommandTraits *Traits;
- const SourceManager *SM;
-
- /// The \c FullComment parent of the comment being dumped.
- const FullComment *FC;
-
- unsigned IndentLevel;
-
-public:
- CommentDumper(raw_ostream &OS,
- const CommandTraits *Traits,
- const SourceManager *SM,
- const FullComment *FC) :
- OS(OS), Traits(Traits), SM(SM), FC(FC), IndentLevel(0)
- { }
-
- void dumpIndent() const {
- for (unsigned i = 1, e = IndentLevel; i < e; ++i)
- OS << " ";
- }
-
- void dumpLocation(SourceLocation Loc) {
- if (SM)
- Loc.print(OS, *SM);
- }
-
- void dumpSourceRange(const Comment *C);
-
- void dumpComment(const Comment *C);
-
- void dumpSubtree(const Comment *C);
-
- // Inline content.
- void visitTextComment(const TextComment *C);
- void visitInlineCommandComment(const InlineCommandComment *C);
- void visitHTMLStartTagComment(const HTMLStartTagComment *C);
- void visitHTMLEndTagComment(const HTMLEndTagComment *C);
-
- // Block content.
- void visitParagraphComment(const ParagraphComment *C);
- void visitBlockCommandComment(const BlockCommandComment *C);
- void visitParamCommandComment(const ParamCommandComment *C);
- void visitTParamCommandComment(const TParamCommandComment *C);
- void visitVerbatimBlockComment(const VerbatimBlockComment *C);
- void visitVerbatimBlockLineComment(const VerbatimBlockLineComment *C);
- void visitVerbatimLineComment(const VerbatimLineComment *C);
-
- void visitFullComment(const FullComment *C);
-
- const char *getCommandName(unsigned CommandID) {
- if (Traits)
- return Traits->getCommandInfo(CommandID)->Name;
- const CommandInfo *Info = CommandTraits::getBuiltinCommandInfo(CommandID);
- if (Info)
- return Info->Name;
- return "<not a builtin command>";
- }
-};
-
-void CommentDumper::dumpSourceRange(const Comment *C) {
- if (!SM)
- return;
-
- SourceRange SR = C->getSourceRange();
-
- OS << " <";
- dumpLocation(SR.getBegin());
- if (SR.getBegin() != SR.getEnd()) {
- OS << ", ";
- dumpLocation(SR.getEnd());
- }
- OS << ">";
-}
-
-void CommentDumper::dumpComment(const Comment *C) {
- dumpIndent();
- OS << "(" << C->getCommentKindName()
- << " " << (const void *) C;
- dumpSourceRange(C);
-}
-
-void CommentDumper::dumpSubtree(const Comment *C) {
- ++IndentLevel;
- if (C) {
- visit(C);
- for (Comment::child_iterator I = C->child_begin(),
- E = C->child_end();
- I != E; ++I) {
- OS << '\n';
- dumpSubtree(*I);
- }
- OS << ')';
- } else {
- dumpIndent();
- OS << "<<<NULL>>>";
- }
- --IndentLevel;
-}
-
-void CommentDumper::visitTextComment(const TextComment *C) {
- dumpComment(C);
-
- OS << " Text=\"" << C->getText() << "\"";
-}
-
-void CommentDumper::visitInlineCommandComment(const InlineCommandComment *C) {
- dumpComment(C);
-
- OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
- switch (C->getRenderKind()) {
- case InlineCommandComment::RenderNormal:
- OS << " RenderNormal";
- break;
- case InlineCommandComment::RenderBold:
- OS << " RenderBold";
- break;
- case InlineCommandComment::RenderMonospaced:
- OS << " RenderMonospaced";
- break;
- case InlineCommandComment::RenderEmphasized:
- OS << " RenderEmphasized";
- break;
- }
-
- for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
- OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
-}
-
-void CommentDumper::visitHTMLStartTagComment(const HTMLStartTagComment *C) {
- dumpComment(C);
-
- OS << " Name=\"" << C->getTagName() << "\"";
- if (C->getNumAttrs() != 0) {
- OS << " Attrs: ";
- for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
- const HTMLStartTagComment::Attribute &Attr = C->getAttr(i);
- OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
- }
- }
- if (C->isSelfClosing())
- OS << " SelfClosing";
-}
-
-void CommentDumper::visitHTMLEndTagComment(const HTMLEndTagComment *C) {
- dumpComment(C);
-
- OS << " Name=\"" << C->getTagName() << "\"";
-}
-
-void CommentDumper::visitParagraphComment(const ParagraphComment *C) {
- dumpComment(C);
-}
-
-void CommentDumper::visitBlockCommandComment(const BlockCommandComment *C) {
- dumpComment(C);
-
- OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
- for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
- OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
-}
-
-void CommentDumper::visitParamCommandComment(const ParamCommandComment *C) {
- dumpComment(C);
-
- OS << " " << ParamCommandComment::getDirectionAsString(C->getDirection());
-
- if (C->isDirectionExplicit())
- OS << " explicitly";
- else
- OS << " implicitly";
-
- if (C->hasParamName()) {
- if (C->isParamIndexValid())
- OS << " Param=\"" << C->getParamName(FC) << "\"";
- else
- OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
- }
-
- if (C->isParamIndexValid())
- OS << " ParamIndex=" << C->getParamIndex();
-}
-
-void CommentDumper::visitTParamCommandComment(const TParamCommandComment *C) {
- dumpComment(C);
-
- if (C->hasParamName()) {
- if (C->isPositionValid())
- OS << " Param=\"" << C->getParamName(FC) << "\"";
- else
- OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
- }
-
- if (C->isPositionValid()) {
- OS << " Position=<";
- for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
- OS << C->getIndex(i);
- if (i != e - 1)
- OS << ", ";
- }
- OS << ">";
- }
-}
-
-void CommentDumper::visitVerbatimBlockComment(const VerbatimBlockComment *C) {
- dumpComment(C);
-
- OS << " Name=\"" << getCommandName(C->getCommandID()) << "\""
- " CloseName=\"" << C->getCloseName() << "\"";
-}
-
-void CommentDumper::visitVerbatimBlockLineComment(const VerbatimBlockLineComment *C) {
- dumpComment(C);
-
- OS << " Text=\"" << C->getText() << "\"";
-}
-
-void CommentDumper::visitVerbatimLineComment(const VerbatimLineComment *C) {
- dumpComment(C);
-
- OS << " Text=\"" << C->getText() << "\"";
-}
-
-void CommentDumper::visitFullComment(const FullComment *C) {
- dumpComment(C);
-}
-
-} // unnamed namespace
-
-void Comment::dump(raw_ostream &OS, const CommandTraits *Traits,
- const SourceManager *SM) const {
- const FullComment *FC = dyn_cast<FullComment>(this);
- CommentDumper D(llvm::errs(), Traits, SM, FC);
- D.dumpSubtree(this);
- llvm::errs() << '\n';
-}
-
-} // end namespace comments
-} // end namespace clang
-
Added: cfe/trunk/test/Misc/ast-dump-comment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-comment.cpp?rev=172409&view=auto
==============================================================================
--- cfe/trunk/test/Misc/ast-dump-comment.cpp (added)
+++ cfe/trunk/test/Misc/ast-dump-comment.cpp Mon Jan 14 08:07:11 2013
@@ -0,0 +1,69 @@
+// RUN: %clang_cc1 -Wdocumentation -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s
+
+/// Aaa
+int TestLocation;
+// CHECK: VarDecl{{.*}}TestLocation
+// CHECK-NEXT: FullComment 0x{{[^ ]*}} <line:[[@LINE-3]]:4, col:7>
+
+///
+int TestIndent;
+// CHECK: {{^\(VarDecl.*TestIndent[^()]*$}}
+// CHECK-NEXT: {{^ \(FullComment.*>\)\)$}}
+
+/// Aaa
+int Test_TextComment;
+// CHECK: VarDecl{{.*}}Test_TextComment
+// CHECK-NEXT: FullComment
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
+
+/// \brief Aaa
+int Test_BlockCommandComment;
+// CHECK: VarDecl{{.*}}Test_BlockCommandComment
+// CHECK: BlockCommandComment{{.*}} Name="brief"
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" Aaa"
+
+/// \param Aaa xxx
+/// \param [in,out] Bbb yyy
+void Test_ParamCommandComment(int Aaa, int Bbb);
+// CHECK: FunctionDecl{{.*}}Test_ParamCommandComment
+// CHECK: ParamCommandComment{{.*}} [in] implicitly Param="Aaa" ParamIndex=0
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" xxx"
+// CHECK: ParamCommandComment{{.*}} [in,out] explicitly Param="Bbb" ParamIndex=1
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" yyy"
+
+/// \tparam Aaa xxx
+template <typename Aaa> class Test_TParamCommandComment;
+// CHECK: ClassTemplateDecl{{.*}}Test_TParamCommandComment
+// CHECK: TParamCommandComment{{.*}} Param="Aaa" Position=<0>
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" xxx"
+
+/// \c Aaa
+int Test_InlineCommandComment;
+// CHECK: VarDecl{{.*}}Test_InlineCommandComment
+// CHECK: InlineCommandComment{{.*}} Name="c" RenderMonospaced Arg[0]="Aaa"
+
+/// <a>Aaa</a>
+/// <br/>
+int Test_HTMLTagComment;
+// CHECK: VarDecl{{.*}}Test_HTMLTagComment
+// CHECK-NEXT: FullComment
+// CHECK-NEXT: ParagraphComment
+// CHECK-NEXT: TextComment{{.*}} Text=" "
+// CHECK-NEXT: HTMLStartTagComment{{.*}} Name="a"
+// CHECK-NEXT: TextComment{{.*}} Text="Aaa"
+// CHECK-NEXT: HTMLEndTagComment{{.*}} Name="a"
+// CHECK-NEXT: TextComment{{.*}} Text=" "
+// CHECK-NEXT: HTMLStartTagComment{{.*}} Name="br" SelfClosing
+
+/// \verbatim
+/// Aaa
+/// \endverbatim
+int Test_VerbatimBlockComment;
+// CHECK: VarDecl{{.*}}Test_VerbatimBlockComment
+// CHECK: VerbatimBlockComment{{.*}} Name="verbatim" CloseName="endverbatim"
+// CHECK-NEXT: VerbatimBlockLineComment{{.*}} Text=" Aaa"
More information about the cfe-commits
mailing list