From: Richard Trieu Date: Sat, 26 Jan 2013 01:31:20 +0000 (+0000) Subject: Highlight various parts of the AST dump with color. Colors are controlled by X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ba443aa8cfb222737d3a964a19ad4fb1328c4b5;p=clang Highlight various parts of the AST dump with color. Colors are controlled by -f(no-)color-diagnostics. In addition, dumpColor() function calls are added to force color printing. No structural changes to -ast-dump. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h index 83fa8be0ee..78b703d78a 100644 --- a/include/clang/AST/Comment.h +++ b/include/clang/AST/Comment.h @@ -171,6 +171,7 @@ public: const char *getCommentKindName() const; LLVM_ATTRIBUTE_USED void dump() const; + LLVM_ATTRIBUTE_USED void dumpColor() const; LLVM_ATTRIBUTE_USED void dump(const ASTContext &Context) const; void dump(raw_ostream &OS, const CommandTraits *Traits, const SourceManager *SM) const; diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index bf588d77d6..efac2fba64 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -862,6 +862,8 @@ public: unsigned Indentation = 0); // Debuggers don't usually respect default arguments. LLVM_ATTRIBUTE_USED void dump() const; + // Same as dump(), but forces color printing. + LLVM_ATTRIBUTE_USED void dumpColor() const; void dump(raw_ostream &Out) const; // Debuggers don't usually respect default arguments. LLVM_ATTRIBUTE_USED void dumpXML() const; diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 2a1af77b8c..477e554d5f 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -373,6 +373,9 @@ public: LLVM_ATTRIBUTE_USED void dump(SourceManager &SM) const; void dump(raw_ostream &OS, SourceManager &SM) const; + /// dumpColor - same as dump(), but forces color highlighting. + LLVM_ATTRIBUTE_USED void dumpColor() const; + /// dumpPretty/printPretty - These two methods do a "pretty print" of the AST /// back to its original source language syntax. void dumpPretty(ASTContext &Context) const; diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index 29680c47e3..6248da045a 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -30,6 +30,46 @@ using namespace clang::comments; //===----------------------------------------------------------------------===// namespace { + // Colors used for various parts of the AST dump + + struct TerminalColor { + raw_ostream::Colors Color; + bool Bold; + }; + + // Decl kind names (VarDecl, FunctionDecl, etc) + static const TerminalColor DeclKindNameColor = { raw_ostream::GREEN, true }; + // Attr names (CleanupAttr, GuardedByAttr, etc) + static const TerminalColor AttrColor = { raw_ostream::BLUE, true }; + // Statement names (DeclStmt, ImplicitCastExpr, etc) + static const TerminalColor StmtColor = { raw_ostream::MAGENTA, true }; + // Comment names (FullComment, ParagraphComment, TextComment, etc) + static const TerminalColor CommentColor = { raw_ostream::YELLOW, true }; + + // Type names (int, float, etc, plus user defined types) + static const TerminalColor TypeColor = { raw_ostream::GREEN, false }; + + // Pointer address + static const TerminalColor AddressColor = { raw_ostream::YELLOW, false }; + // Source locations + static const TerminalColor LocationColor = { raw_ostream::YELLOW, false }; + + // lvalue/xvalue + static const TerminalColor ValueKindColor = { raw_ostream::CYAN, false }; + // bitfield/objcproperty/objcsubscript/vectorcomponent + static const TerminalColor ObjectKindColor = { raw_ostream::CYAN, false }; + + // Null statements + static const TerminalColor NullColor = { raw_ostream::BLUE, false }; + + // CastKind from CastExpr's + static const TerminalColor CastColor = { raw_ostream::RED, false }; + + // Value of the statement + static const TerminalColor ValueColor = { raw_ostream::CYAN, true }; + // Decl names + static const TerminalColor DeclNameColor = { raw_ostream::CYAN, true }; + class ASTDumper : public DeclVisitor, public StmtVisitor, public ConstCommentVisitor { @@ -47,6 +87,8 @@ namespace { /// The \c FullComment parent of the comment being dumped. const FullComment *FC; + bool ShowColors; + class IndentScope { ASTDumper &Dumper; public: @@ -58,11 +100,31 @@ namespace { } }; + class ColorScope { + ASTDumper &Dumper; + public: + ColorScope(ASTDumper &Dumper, TerminalColor Color) + : Dumper(Dumper) { + if (Dumper.ShowColors) + Dumper.OS.changeColor(Color.Color, Color.Bold); + } + ~ColorScope() { + if (Dumper.ShowColors) + Dumper.OS.resetColor(); + } + }; + public: 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) { } + LastLocFilename(""), LastLocLine(~0U), FC(0), + ShowColors(SM && SM->getDiagnostics().getShowColors()) { } + + ASTDumper(raw_ostream &OS, const CommandTraits *Traits, + const SourceManager *SM, bool ShowColors) + : OS(OS), Traits(Traits), SM(SM), IndentLevel(0), IsFirstLine(true), + LastLocFilename(""), LastLocLine(~0U), ShowColors(ShowColors) { } ~ASTDumper() { OS << "\n"; @@ -238,10 +300,12 @@ void ASTDumper::unindent() { } void ASTDumper::dumpPointer(const void *Ptr) { + ColorScope Color(*this, AddressColor); OS << ' ' << Ptr; } void ASTDumper::dumpLocation(SourceLocation Loc) { + ColorScope Color(*this, LocationColor); SourceLocation SpellingLoc = SM->getSpellingLoc(Loc); // The general format we print out is filename:line:col, but we drop pieces @@ -285,6 +349,8 @@ void ASTDumper::dumpSourceRange(SourceRange R) { } void ASTDumper::dumpBareType(QualType T) { + ColorScope Color(*this, TypeColor); + SplitQualType T_split = T.split(); OS << "'" << QualType::getAsString(T_split) << "'"; @@ -302,10 +368,14 @@ void ASTDumper::dumpType(QualType T) { } void ASTDumper::dumpBareDeclRef(const Decl *D) { - OS << D->getDeclKindName(); + { + ColorScope Color(*this, DeclKindNameColor); + OS << D->getDeclKindName(); + } dumpPointer(D); if (const NamedDecl *ND = dyn_cast(D)) { + ColorScope Color(*this, DeclNameColor); OS << " '"; ND->getDeclName().printName(OS); OS << "'"; @@ -326,8 +396,10 @@ void ASTDumper::dumpDeclRef(const Decl *D, const char *Label) { } void ASTDumper::dumpName(const NamedDecl *ND) { - if (ND->getDeclName()) + if (ND->getDeclName()) { + ColorScope Color(*this, DeclNameColor); OS << ' ' << ND->getNameAsString(); + } } void ASTDumper::dumpDeclContext(const DeclContext *DC) { @@ -340,12 +412,15 @@ void ASTDumper::dumpDeclContext(const DeclContext *DC) { void ASTDumper::dumpAttr(const Attr *A) { IndentScope Indent(*this); - switch (A->getKind()) { + { + ColorScope Color(*this, AttrColor); + switch (A->getKind()) { #define ATTR(X) case attr::X: OS << #X; break; #include "clang/Basic/AttrList.inc" - default: llvm_unreachable("unexpected attribute kind"); + default: llvm_unreachable("unexpected attribute kind"); + } + OS << "Attr"; } - OS << "Attr"; dumpPointer(A); dumpSourceRange(A->getRange()); #include "clang/AST/AttrDump.inc" @@ -460,11 +535,15 @@ void ASTDumper::dumpDecl(Decl *D) { IndentScope Indent(*this); if (!D) { + ColorScope Color(*this, NullColor); OS << "<<>>"; return; } - OS << D->getDeclKindName() << "Decl"; + { + ColorScope Color(*this, DeclKindNameColor); + OS << D->getDeclKindName() << "Decl"; + } dumpPointer(D); dumpSourceRange(D->getSourceRange()); DeclVisitor::Visit(D); @@ -981,6 +1060,7 @@ void ASTDumper::dumpStmt(Stmt *S) { IndentScope Indent(*this); if (!S) { + ColorScope Color(*this, NullColor); OS << "<<>>"; return; } @@ -996,7 +1076,10 @@ void ASTDumper::dumpStmt(Stmt *S) { } void ASTDumper::VisitStmt(Stmt *Node) { - OS << Node->getStmtClassName(); + { + ColorScope Color(*this, StmtColor); + OS << Node->getStmtClassName(); + } dumpPointer(Node); dumpSourceRange(Node->getSourceRange()); } @@ -1034,32 +1117,38 @@ void ASTDumper::VisitExpr(Expr *Node) { VisitStmt(Node); dumpType(Node->getType()); - switch (Node->getValueKind()) { - case VK_RValue: - break; - case VK_LValue: - OS << " lvalue"; - break; - case VK_XValue: - OS << " xvalue"; - break; + { + ColorScope Color(*this, ValueKindColor); + switch (Node->getValueKind()) { + case VK_RValue: + break; + case VK_LValue: + OS << " lvalue"; + break; + case VK_XValue: + OS << " xvalue"; + break; + } } - switch (Node->getObjectKind()) { - case OK_Ordinary: - break; - case OK_BitField: - OS << " bitfield"; - break; - case OK_ObjCProperty: - OS << " objcproperty"; - break; - case OK_ObjCSubscript: - OS << " objcsubscript"; - break; - case OK_VectorComponent: - OS << " vectorcomponent"; - break; + { + ColorScope Color(*this, ObjectKindColor); + switch (Node->getObjectKind()) { + case OK_Ordinary: + break; + case OK_BitField: + OS << " bitfield"; + break; + case OK_ObjCProperty: + OS << " objcproperty"; + break; + case OK_ObjCSubscript: + OS << " objcsubscript"; + break; + case OK_VectorComponent: + OS << " vectorcomponent"; + break; + } } } @@ -1089,7 +1178,11 @@ static void dumpBasePath(raw_ostream &OS, CastExpr *Node) { void ASTDumper::VisitCastExpr(CastExpr *Node) { VisitExpr(Node); - OS << " <" << Node->getCastKindName(); + OS << " <"; + { + ColorScope Color(*this, CastColor); + OS << Node->getCastKindName(); + } dumpBasePath(OS, Node); OS << ">"; } @@ -1124,8 +1217,11 @@ void ASTDumper::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *Node) { void ASTDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { VisitExpr(Node); - OS << " " << Node->getDecl()->getDeclKindName() - << "Decl='" << *Node->getDecl() << "'"; + { + ColorScope Color(*this, DeclKindNameColor); + OS << " " << Node->getDecl()->getDeclKindName() << "Decl"; + } + OS << "='" << *Node->getDecl() << "'"; dumpPointer(Node->getDecl()); if (Node->isFreeIvar()) OS << " isFreeIvar"; @@ -1144,6 +1240,7 @@ void ASTDumper::VisitPredefinedExpr(PredefinedExpr *Node) { void ASTDumper::VisitCharacterLiteral(CharacterLiteral *Node) { VisitExpr(Node); + ColorScope Color(*this, ValueColor); OS << " " << Node->getValue(); } @@ -1151,16 +1248,19 @@ void ASTDumper::VisitIntegerLiteral(IntegerLiteral *Node) { VisitExpr(Node); bool isSigned = Node->getType()->isSignedIntegerType(); + ColorScope Color(*this, ValueColor); OS << " " << Node->getValue().toString(10, isSigned); } void ASTDumper::VisitFloatingLiteral(FloatingLiteral *Node) { VisitExpr(Node); + ColorScope Color(*this, ValueColor); OS << " " << Node->getValueAsApproximateDouble(); } void ASTDumper::VisitStringLiteral(StringLiteral *Str) { VisitExpr(Str); + ColorScope Color(*this, ValueColor); OS << " "; Str->outputString(OS); } @@ -1429,11 +1529,15 @@ void ASTDumper::dumpComment(const Comment *C) { IndentScope Indent(*this); if (!C) { + ColorScope Color(*this, NullColor); OS << "<<>>"; return; } - OS << C->getCommentKindName(); + { + ColorScope Color(*this, CommentColor); + OS << C->getCommentKindName(); + } dumpPointer(C); dumpSourceRange(C->getSourceRange()); ConstCommentVisitor::visit(C); @@ -1556,6 +1660,11 @@ void Decl::dump(raw_ostream &OS) const { P.dumpDecl(const_cast(this)); } +void Decl::dumpColor() const { + ASTDumper P(llvm::errs(), &getASTContext().getCommentCommandTraits(), + &getASTContext().getSourceManager(), /*ShowColors*/true); + P.dumpDecl(const_cast(this)); +} //===----------------------------------------------------------------------===// // Stmt method implementations //===----------------------------------------------------------------------===// @@ -1574,6 +1683,11 @@ void Stmt::dump() const { P.dumpStmt(const_cast(this)); } +void Stmt::dumpColor() const { + ASTDumper P(llvm::errs(), 0, 0, /*ShowColors*/true); + P.dumpStmt(const_cast(this)); +} + //===----------------------------------------------------------------------===// // Comment method implementations //===----------------------------------------------------------------------===// @@ -1593,3 +1707,9 @@ void Comment::dump(raw_ostream &OS, const CommandTraits *Traits, ASTDumper D(OS, Traits, SM); D.dumpFullComment(FC); } + +void Comment::dumpColor() const { + const FullComment *FC = dyn_cast(this); + ASTDumper D(llvm::errs(), 0, 0, /*ShowColors*/true); + D.dumpFullComment(FC); +} diff --git a/test/Misc/ast-dump-color.cpp b/test/Misc/ast-dump-color.cpp new file mode 100644 index 0000000000..09f0785ce0 --- /dev/null +++ b/test/Misc/ast-dump-color.cpp @@ -0,0 +1,87 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++11 -ast-dump -fcolor-diagnostics %s | FileCheck --strict-whitespace %s +// REQUIRES: ansi-escape-sequences + +/// Hello +///
+int Test __attribute__((unused)); + +/// Comment +void TestAttributedStmt() { + switch (1) { + case 1: + [[clang::fallthrough]]; + case 2: + ; + } +} + +class __attribute__((lockable)) Mutex { + /// A variable + int var1; + /// Another variable + /// + /// Like the other variable, but different + int var2; +} mu1, mu2; +int TestExpr __attribute__((guarded_by(mu1))); + +//CHECK: {{^}}({{.}}[0;1;32mTranslationUnitDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33m{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;32mTypedefDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33m{{.}}[0m>{{.}}[0;1;36m __int128_t{{.}}[0m {{.}}[0;32m'__int128'{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mTypedefDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33m{{.}}[0m>{{.}}[0;1;36m __uint128_t{{.}}[0m {{.}}[0;32m'unsigned __int128'{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mTypedefDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33m{{.}}[0m>{{.}}[0;1;36m __builtin_va_list{{.}}[0m {{.}}[0;32m'__va_list_tag [1]'{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33m{{[a-zA-Z0-9\\\/]*}}ast-dump-color.cpp:6:1{{.}}[0m, {{.}}[0;33mcol:5{{.}}[0m>{{.}}[0;1;36m Test{{.}}[0m {{.}}[0;32m'int'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;34mUnusedAttr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:25{{.}}[0m>){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mFullComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:4:4{{.}}[0m, {{.}}[0;33mline:5:8{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mParagraphComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:4:4{{.}}[0m, {{.}}[0;33mline:5:8{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:4:4{{.}}[0m> Text=" "){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mHTMLStartTagComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:5{{.}}[0m, {{.}}[0;33mcol:7{{.}}[0m> Name="a"){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:8{{.}}[0m, {{.}}[0;33mcol:12{{.}}[0m> Text="Hello"){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mHTMLEndTagComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:13{{.}}[0m, {{.}}[0;33mcol:16{{.}}[0m> Name="a"){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:5:4{{.}}[0m> Text=" "){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mHTMLStartTagComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:5{{.}}[0m, {{.}}[0;33mcol:8{{.}}[0m> Name="br" SelfClosing)))){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mFunctionDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:9:1{{.}}[0m, {{.}}[0;33mline:16:1{{.}}[0m>{{.}}[0;1;36m TestAttributedStmt{{.}}[0m {{.}}[0;32m'void (void)'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCompoundStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:9:27{{.}}[0m, {{.}}[0;33mline:16:1{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mSwitchStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:10:3{{.}}[0m, {{.}}[0;33mline:15:3{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;34m<<>>{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mIntegerLiteral{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:10:11{{.}}[0m> {{.}}[0;32m'int'{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;1;36m 1{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCompoundStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:14{{.}}[0m, {{.}}[0;33mline:15:3{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCaseStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:11:3{{.}}[0m, {{.}}[0;33mline:12:27{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mIntegerLiteral{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:11:8{{.}}[0m> {{.}}[0;32m'int'{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;1;36m 1{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;34m<<>>{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mAttributedStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:12:5{{.}}[0m, {{.}}[0;33mcol:27{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;34mFallThroughAttr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:7{{.}}[0m, {{.}}[0;33mcol:14{{.}}[0m>){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mNullStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:27{{.}}[0m>))){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCaseStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:13:3{{.}}[0m, {{.}}[0;33mline:14:5{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mIntegerLiteral{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:13:8{{.}}[0m> {{.}}[0;32m'int'{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;1;36m 2{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;34m<<>>{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;35mNullStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:14:5{{.}}[0m>))))){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mFullComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:8:4{{.}}[0m, {{.}}[0;33mcol:11{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mParagraphComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:4{{.}}[0m, {{.}}[0;33mcol:11{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:4{{.}}[0m, {{.}}[0;33mcol:11{{.}}[0m> Text=" Comment")))){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mCXXRecordDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:18:1{{.}}[0m, {{.}}[0;33mline:25:1{{.}}[0m> class{{.}}[0;1;36m Mutex{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;34mLockableAttr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:18:22{{.}}[0m>){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mCXXRecordDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:1{{.}}[0m, {{.}}[0;33mcol:33{{.}}[0m> class{{.}}[0;1;36m Mutex{{.}}[0m){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mFieldDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:20:3{{.}}[0m, {{.}}[0;33mcol:7{{.}}[0m>{{.}}[0;1;36m var1{{.}}[0m {{.}}[0;32m'int'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mFullComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:19:6{{.}}[0m, {{.}}[0;33mcol:16{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mParagraphComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:6{{.}}[0m, {{.}}[0;33mcol:16{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:6{{.}}[0m, {{.}}[0;33mcol:16{{.}}[0m> Text=" A variable")))){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mFieldDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:24:3{{.}}[0m, {{.}}[0;33mcol:7{{.}}[0m>{{.}}[0;1;36m var2{{.}}[0m {{.}}[0;32m'int'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mFullComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:21:6{{.}}[0m, {{.}}[0;33mline:23:44{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mParagraphComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:21:6{{.}}[0m, {{.}}[0;33mcol:22{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:6{{.}}[0m, {{.}}[0;33mcol:22{{.}}[0m> Text=" Another variable")){{$}} +//CHECK: {{^}} ({{.}}[0;1;33mParagraphComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:23:6{{.}}[0m, {{.}}[0;33mcol:44{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;33mTextComment{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:6{{.}}[0m, {{.}}[0;33mcol:44{{.}}[0m> Text=" Like the other variable, but different")))){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mCXXConstructorDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:18:33{{.}}[0m>{{.}}[0;1;36m Mutex{{.}}[0m {{.}}[0;32m'void (void)'{{.}}[0m inline{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCompoundStmt{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:33{{.}}[0m>)){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mCXXConstructorDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:33{{.}}[0m>{{.}}[0;1;36m Mutex{{.}}[0m {{.}}[0;32m'void (const class Mutex &)'{{.}}[0m inline{{$}} +//CHECK: {{^}} ({{.}}[0;1;32mParmVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:33{{.}}[0m> {{.}}[0;32m'const class Mutex &'{{.}}[0m)){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mCXXConstructorDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:33{{.}}[0m>{{.}}[0;1;36m Mutex{{.}}[0m {{.}}[0;32m'void (class Mutex &&)'{{.}}[0m inline{{$}} +//CHECK: {{^}} ({{.}}[0;1;32mParmVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:33{{.}}[0m> {{.}}[0;32m'class Mutex &&'{{.}}[0m))){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:1{{.}}[0m, {{.}}[0;33mline:25:3{{.}}[0m>{{.}}[0;1;36m mu1{{.}}[0m {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCXXConstructExpr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:3{{.}}[0m> {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;36m{{.}}[0m {{.}}[0;32m'void (void)'{{.}}[0m)){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:18:1{{.}}[0m, {{.}}[0;33mline:25:8{{.}}[0m>{{.}}[0;1;36m mu2{{.}}[0m {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mCXXConstructExpr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:8{{.}}[0m> {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m{{.}}[0;36m{{.}}[0m{{.}}[0;36m{{.}}[0m {{.}}[0;32m'void (void)'{{.}}[0m)){{$}} +//CHECK: {{^}} ({{.}}[0;1;32mVarDecl{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mline:26:1{{.}}[0m, {{.}}[0;33mcol:5{{.}}[0m>{{.}}[0;1;36m TestExpr{{.}}[0m {{.}}[0;32m'int'{{.}}[0m{{$}} +//CHECK: {{^}} ({{.}}[0;1;34mGuardedByAttr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:29{{.}}[0m>{{$}} +//CHECK: {{^}} ({{.}}[0;1;35mDeclRefExpr{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m <{{.}}[0;33mcol:40{{.}}[0m> {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m{{.}}[0;36m lvalue{{.}}[0m{{.}}[0;36m{{.}}[0m {{.}}[0;1;32mVar{{.}}[0m{{.}}[0;33m 0x{{[0-9a-fA-F]*}}{{.}}[0m{{.}}[0;1;36m 'mu1'{{.}}[0m {{.}}[0;32m'class Mutex':'class Mutex'{{.}}[0m)))){{$}} +