<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">Nice!<br><br><div class="gmail_quote">On Wed, Dec 19, 2012 at 6:09 PM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: alexfh<br>
Date: Wed Dec 19 20:09:13 2012<br>
New Revision: 170634<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=170634&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=170634&view=rev</a><br>
Log:<br>
Implement AST dumper for Decls.<br>
<a href="http://llvm-reviews.chandlerc.com/D52" target="_blank">http://llvm-reviews.chandlerc.com/D52</a><br>
<br>
Patch by Philip Craig!<br>
<br>
<br>
Added:<br>
cfe/trunk/test/Misc/ast-dump-decl.c<br>
cfe/trunk/test/Misc/ast-dump-decl.cpp<br>
cfe/trunk/test/Misc/ast-dump-decl.m<br>
cfe/trunk/test/Misc/<a href="http://ast-dump-decl.mm" target="_blank">ast-dump-decl.mm</a><br>
Modified:<br>
cfe/trunk/include/clang/AST/PrettyPrinter.h<br>
cfe/trunk/include/clang/AST/TemplateName.h<br>
cfe/trunk/lib/AST/ASTDumper.cpp<br>
cfe/trunk/lib/AST/DeclPrinter.cpp<br>
cfe/trunk/lib/AST/StmtPrinter.cpp<br>
cfe/trunk/lib/AST/TemplateName.cpp<br>
cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp<br>
cfe/trunk/test/CodeGen/bitfield-2.c<br>
cfe/trunk/test/Misc/ast-dump-stmt.c<br>
cfe/trunk/test/Misc/ast-dump-stmt.m<br>
cfe/trunk/test/Misc/ast-dump-templates.cpp<br>
cfe/trunk/test/Misc/ast-dump-wchar.cpp<br>
cfe/trunk/test/PCH/objc_stmts.m<br>
cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp<br>
cfe/trunk/test/Tooling/clang-check-ast-dump.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/PrettyPrinter.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/PrettyPrinter.h?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/PrettyPrinter.h?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/PrettyPrinter.h (original)<br>
+++ cfe/trunk/include/clang/AST/PrettyPrinter.h Wed Dec 19 20:09:13 2012<br>
@@ -40,8 +40,7 @@<br>
SuppressUnwrittenScope(false), SuppressInitializers(false),<br>
ConstantArraySizeAsWritten(false), AnonymousTagLocations(true),<br>
SuppressStrongLifetime(false), Bool(LO.Bool),<br>
- TerseOutput(false), PolishForDeclaration(false),<br>
- DumpSourceManager(0) { }<br>
+ TerseOutput(false), PolishForDeclaration(false) { }<br>
<br>
/// \brief What language we're printing.<br>
LangOptions LangOpts;<br>
@@ -147,12 +146,6 @@<br>
/// declaration tag; such as, do not print attributes attached to the declaration.<br>
///<br>
unsigned PolishForDeclaration : 1;<br>
-<br>
- /// \brief If we are "dumping" rather than "pretty-printing", this points to<br>
- /// a SourceManager which will be used to dump SourceLocations. Dumping<br>
- /// involves printing the internal details of the AST and pretty-printing<br>
- /// involves printing something similar to source code.<br>
- SourceManager *DumpSourceManager;<br>
};<br>
<br>
} // end namespace clang<br>
<br>
Modified: cfe/trunk/include/clang/AST/TemplateName.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TemplateName.h?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TemplateName.h?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/TemplateName.h (original)<br>
+++ cfe/trunk/include/clang/AST/TemplateName.h Wed Dec 19 20:09:13 2012<br>
@@ -308,6 +308,9 @@<br>
void print(raw_ostream &OS, const PrintingPolicy &Policy,<br>
bool SuppressNNS = false) const;<br>
<br>
+ /// \brief Debugging aid that dumps the template name.<br>
+ void dump(raw_ostream &OS) const;<br>
+<br>
/// \brief Debugging aid that dumps the template name to standard<br>
/// error.<br>
void dump() const;<br>
<br>
Modified: cfe/trunk/lib/AST/ASTDumper.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTDumper.cpp Wed Dec 19 20:09:13 2012<br>
@@ -12,11 +12,12 @@<br>
//<br>
//===----------------------------------------------------------------------===//<br>
<br>
-#include "clang/AST/PrettyPrinter.h"<br>
#include "clang/AST/ASTContext.h"<br>
#include "clang/AST/DeclCXX.h"<br>
#include "clang/AST/DeclObjC.h"<br>
+#include "clang/AST/DeclVisitor.h"<br>
#include "clang/AST/StmtVisitor.h"<br>
+#include "clang/Basic/Module.h"<br>
#include "clang/Basic/SourceManager.h"<br>
#include "llvm/Support/raw_ostream.h"<br>
using namespace clang;<br>
@@ -26,7 +27,8 @@<br>
//===----------------------------------------------------------------------===//<br>
<br>
namespace {<br>
- class ASTDumper : public StmtVisitor<ASTDumper> {<br>
+ class ASTDumper<br>
+ : public DeclVisitor<ASTDumper>, public StmtVisitor<ASTDumper> {<br>
SourceManager *SM;<br>
raw_ostream &OS;<br>
unsigned IndentLevel;<br>
@@ -63,10 +65,78 @@<br>
// Utilities<br>
void indent();<br>
void unindent();<br>
- void dumpSourceRange(const Stmt *Node);<br>
+ void dumpPointer(const void *Ptr);<br>
+ void dumpSourceRange(SourceRange R);<br>
void dumpLocation(SourceLocation Loc);<br>
+ void dumpBareType(QualType T);<br>
void dumpType(QualType T);<br>
- void dumpDeclRef(Decl *node);<br>
+ void dumpBareDeclRef(Decl *node);<br>
+ void dumpDeclRef(Decl *node, const char *Label = NULL);<br>
+ void dumpName(NamedDecl *D);<br>
+ void dumpDeclContext(DeclContext *DC);<br>
+<br>
+ // C++ Utilities<br>
+ void dumpAccessSpecifier(AccessSpecifier AS);<br>
+ void dumpCXXCtorInitializer(CXXCtorInitializer *Init);<br>
+ void dumpTemplateParameters(TemplateParameterList *TPL);<br>
+ void dumpTemplateArgumentListInfo(const TemplateArgumentListInfo &TALI);<br>
+ void dumpTemplateArgumentLoc(const TemplateArgumentLoc &A);<br>
+ void dumpTemplateArgumentList(const TemplateArgumentList &TAL);<br>
+ void dumpTemplateArgument(const TemplateArgument &A,<br>
+ SourceRange R = SourceRange());<br>
+<br>
+ // Decls<br>
+ void VisitLabelDecl(LabelDecl *D);<br>
+ void VisitTypedefDecl(TypedefDecl *D);<br>
+ void VisitEnumDecl(EnumDecl *D);<br>
+ void VisitRecordDecl(RecordDecl *D);<br>
+ void VisitEnumConstantDecl(EnumConstantDecl *D);<br>
+ void VisitIndirectFieldDecl(IndirectFieldDecl *D);<br>
+ void VisitFunctionDecl(FunctionDecl *D);<br>
+ void VisitFieldDecl(FieldDecl *D);<br>
+ void VisitVarDecl(VarDecl *D);<br>
+ void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);<br>
+ void VisitImportDecl(ImportDecl *D);<br>
+<br>
+ // C++ Decls<br>
+ void VisitNamespaceDecl(NamespaceDecl *D);<br>
+ void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);<br>
+ void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);<br>
+ void VisitTypeAliasDecl(TypeAliasDecl *D);<br>
+ void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);<br>
+ void VisitCXXRecordDecl(CXXRecordDecl *D);<br>
+ void VisitStaticAssertDecl(StaticAssertDecl *D);<br>
+ void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);<br>
+ void VisitClassTemplateDecl(ClassTemplateDecl *D);<br>
+ void VisitClassTemplateSpecializationDecl(<br>
+ ClassTemplateSpecializationDecl *D);<br>
+ void VisitClassTemplatePartialSpecializationDecl(<br>
+ ClassTemplatePartialSpecializationDecl *D);<br>
+ void VisitClassScopeFunctionSpecializationDecl(<br>
+ ClassScopeFunctionSpecializationDecl *D);<br>
+ void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);<br>
+ void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);<br>
+ void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);<br>
+ void VisitUsingDecl(UsingDecl *D);<br>
+ void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);<br>
+ void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);<br>
+ void VisitUsingShadowDecl(UsingShadowDecl *D);<br>
+ void VisitLinkageSpecDecl(LinkageSpecDecl *D);<br>
+ void VisitAccessSpecDecl(AccessSpecDecl *D);<br>
+ void VisitFriendDecl(FriendDecl *D);<br>
+<br>
+ // ObjC Decls<br>
+ void VisitObjCIvarDecl(ObjCIvarDecl *D);<br>
+ void VisitObjCMethodDecl(ObjCMethodDecl *D);<br>
+ void VisitObjCCategoryDecl(ObjCCategoryDecl *D);<br>
+ void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);<br>
+ void VisitObjCProtocolDecl(ObjCProtocolDecl *D);<br>
+ void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);<br>
+ void VisitObjCImplementationDecl(ObjCImplementationDecl *D);<br>
+ void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);<br>
+ void VisitObjCPropertyDecl(ObjCPropertyDecl *D);<br>
+ void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);<br>
+ void VisitBlockDecl(BlockDecl *D);<br>
<br>
// Stmts.<br>
void VisitStmt(Stmt *Node);<br>
@@ -137,6 +207,10 @@<br>
IndentLevel--;<br>
}<br>
<br>
+void ASTDumper::dumpPointer(const void *Ptr) {<br>
+ OS << ' ' << Ptr;<br>
+}<br>
+<br>
void ASTDumper::dumpLocation(SourceLocation Loc) {<br>
SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);<br>
<br>
@@ -163,15 +237,11 @@<br>
}<br>
}<br>
<br>
-void ASTDumper::dumpSourceRange(const Stmt *Node) {<br>
+void ASTDumper::dumpSourceRange(SourceRange R) {<br>
// Can't translate locations if a SourceManager isn't available.<br>
if (!SM)<br>
return;<br>
<br>
- // TODO: If the parent expression is available, we can print a delta vs its<br>
- // location.<br>
- SourceRange R = Node->getSourceRange();<br>
-<br>
OS << " <";<br>
dumpLocation(R.getBegin());<br>
if (R.getBegin() != R.getEnd()) {<br>
@@ -184,7 +254,7 @@<br>
<br>
}<br>
<br>
-void ASTDumper::dumpType(QualType T) {<br>
+void ASTDumper::dumpBareType(QualType T) {<br>
SplitQualType T_split = T.split();<br>
OS << "'" << QualType::getAsString(T_split) << "'";<br>
<br>
@@ -196,8 +266,14 @@<br>
}<br>
}<br>
<br>
-void ASTDumper::dumpDeclRef(Decl *D) {<br>
- OS << D->getDeclKindName() << ' ' << (void*) D;<br>
+void ASTDumper::dumpType(QualType T) {<br>
+ OS << ' ';<br>
+ dumpBareType(T);<br>
+}<br>
+<br>
+void ASTDumper::dumpBareDeclRef(Decl *D) {<br>
+ OS << D->getDeclKindName();<br>
+ dumpPointer(D);<br>
<br>
if (NamedDecl *ND = dyn_cast<NamedDecl>(D)) {<br>
OS << " '";<br>
@@ -205,9 +281,132 @@<br>
OS << "'";<br>
}<br>
<br>
- if (ValueDecl *VD = dyn_cast<ValueDecl>(D)) {<br>
- OS << ' ';<br>
+ if (ValueDecl *VD = dyn_cast<ValueDecl>(D))<br>
dumpType(VD->getType());<br>
+}<br>
+<br>
+void ASTDumper::dumpDeclRef(Decl *D, const char *Label) {<br>
+ if (!D)<br>
+ return;<br>
+<br>
+ IndentScope Indent(*this);<br>
+ if (Label)<br>
+ OS << Label << ' ';<br>
+ dumpBareDeclRef(D);<br>
+}<br>
+<br>
+void ASTDumper::dumpName(NamedDecl *ND) {<br>
+ if (ND->getDeclName())<br>
+ OS << ' ' << ND->getNameAsString();<br>
+}<br>
+<br>
+void ASTDumper::dumpDeclContext(DeclContext *DC) {<br>
+ if (!DC)<br>
+ return;<br>
+ for (DeclContext::decl_iterator I = DC->decls_begin(), E = DC->decls_end();<br>
+ I != E; ++I)<br>
+ dumpDecl(*I);<br>
+}<br>
+<br>
+//===----------------------------------------------------------------------===//<br>
+// C++ Utilities<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+void ASTDumper::dumpAccessSpecifier(AccessSpecifier AS) {<br>
+ switch (AS) {<br>
+ case AS_none:<br>
+ break;<br>
+ case AS_public:<br>
+ OS << "public";<br>
+ break;<br>
+ case AS_protected:<br>
+ OS << "protected";<br>
+ break;<br>
+ case AS_private:<br>
+ OS << "private";<br>
+ break;<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::dumpCXXCtorInitializer(CXXCtorInitializer *Init) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "CXXCtorInitializer";<br>
+ if (Init->isAnyMemberInitializer()) {<br>
+ OS << ' ';<br>
+ dumpBareDeclRef(Init->getAnyMember());<br>
+ } else {<br>
+ dumpType(QualType(Init->getBaseClass(), 0));<br>
+ }<br>
+ dumpStmt(Init->getInit());<br>
+}<br>
+<br>
+void ASTDumper::dumpTemplateParameters(TemplateParameterList *TPL) {<br>
+ if (!TPL)<br>
+ return;<br>
+<br>
+ for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end();<br>
+ I != E; ++I)<br>
+ dumpDecl(*I);<br>
+}<br>
+<br>
+void ASTDumper::dumpTemplateArgumentListInfo(<br>
+ const TemplateArgumentListInfo &TALI) {<br>
+ for (unsigned i = 0, e = TALI.size(); i < e; ++i)<br>
+ dumpTemplateArgumentLoc(TALI[i]);<br>
+}<br>
+<br>
+void ASTDumper::dumpTemplateArgumentLoc(const TemplateArgumentLoc &A) {<br>
+ dumpTemplateArgument(A.getArgument(), A.getSourceRange());<br>
+}<br>
+<br>
+void ASTDumper::dumpTemplateArgumentList(const TemplateArgumentList &TAL) {<br>
+ for (unsigned i = 0, e = TAL.size(); i < e; ++i)<br>
+ dumpTemplateArgument(TAL[i]);<br>
+}<br>
+<br>
+void ASTDumper::dumpTemplateArgument(const TemplateArgument &A, SourceRange R) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "TemplateArgument";<br>
+ if (R.isValid())<br>
+ dumpSourceRange(R);<br>
+<br>
+ switch (A.getKind()) {<br>
+ case TemplateArgument::Null:<br>
+ OS << " null";<br>
+ break;<br>
+ case TemplateArgument::Type:<br>
+ OS << " type";<br>
+ dumpType(A.getAsType());<br>
+ break;<br>
+ case TemplateArgument::Declaration:<br>
+ OS << " decl";<br>
+ dumpDeclRef(A.getAsDecl());<br>
+ break;<br>
+ case TemplateArgument::NullPtr:<br>
+ OS << " nullptr";<br>
+ break;<br>
+ case TemplateArgument::Integral:<br>
+ OS << " integral";<br>
+ OS << ' ' << A.getAsIntegral();<br>
+ break;<br>
+ case TemplateArgument::Template:<br>
+ OS << " template ";<br>
+ A.getAsTemplate().dump(OS);<br>
+ break;<br>
+ case TemplateArgument::TemplateExpansion:<br>
+ OS << " template expansion";<br>
+ A.getAsTemplateOrTemplatePattern().dump(OS);<br>
+ break;<br>
+ case TemplateArgument::Expression:<br>
+ OS << " expr";<br>
+ dumpStmt(A.getAsExpr());<br>
+ break;<br>
+ case TemplateArgument::Pack:<br>
+ OS << " pack";<br>
+ for (TemplateArgument::pack_iterator I = A.pack_begin(), E = A.pack_end();<br>
+ I != E; ++I)<br>
+ dumpTemplateArgument(*I);<br>
+ break;<br>
}<br>
}<br>
<br>
@@ -216,71 +415,514 @@<br>
//===----------------------------------------------------------------------===//<br>
<br>
void ASTDumper::dumpDecl(Decl *D) {<br>
- // FIXME: Need to complete/beautify this... this code simply shows the<br>
- // nodes are where they need to be.<br>
- if (TypedefDecl *localType = dyn_cast<TypedefDecl>(D)) {<br>
- OS << "\"typedef " << localType->getUnderlyingType().getAsString()<br>
- << ' ' << *localType << '"';<br>
- } else if (TypeAliasDecl *localType = dyn_cast<TypeAliasDecl>(D)) {<br>
- OS << "\"using " << *localType << " = "<br>
- << localType->getUnderlyingType().getAsString() << '"';<br>
- } else if (ValueDecl *VD = dyn_cast<ValueDecl>(D)) {<br>
- OS << "\"";<br>
- // Emit storage class for vardecls.<br>
- if (VarDecl *V = dyn_cast<VarDecl>(VD)) {<br>
- if (V->getStorageClass() != SC_None)<br>
- OS << VarDecl::getStorageClassSpecifierString(V->getStorageClass())<br>
- << " ";<br>
+ IndentScope Indent(*this);<br>
+<br>
+ if (!D) {<br>
+ OS << "<<<NULL>>>";<br>
+ return;<br>
+ }<br>
+<br>
+ OS << D->getDeclKindName() << "Decl";<br>
+ dumpPointer(D);<br>
+ dumpSourceRange(D->getSourceRange());<br>
+ DeclVisitor<ASTDumper>::Visit(D);<br>
+ // Decls within functions are visited by the body<br>
+ if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D))<br>
+ dumpDeclContext(dyn_cast<DeclContext>(D));<br>
+}<br>
+<br>
+void ASTDumper::VisitLabelDecl(LabelDecl *D) {<br>
+ dumpName(D);<br>
+}<br>
+<br>
+void ASTDumper::VisitTypedefDecl(TypedefDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getUnderlyingType());<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+}<br>
+<br>
+void ASTDumper::VisitEnumDecl(EnumDecl *D) {<br>
+ if (D->isScoped()) {<br>
+ if (D->isScopedUsingClassTag())<br>
+ OS << " class";<br>
+ else<br>
+ OS << " struct";<br>
+ }<br>
+ dumpName(D);<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+ if (D->isFixed())<br>
+ dumpType(D->getIntegerType());<br>
+}<br>
+<br>
+void ASTDumper::VisitRecordDecl(RecordDecl *D) {<br>
+ OS << ' ' << D->getKindName();<br>
+ dumpName(D);<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+}<br>
+<br>
+void ASTDumper::VisitEnumConstantDecl(EnumConstantDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+ if (Expr *Init = D->getInitExpr())<br>
+ dumpStmt(Init);<br>
+}<br>
+<br>
+void ASTDumper::VisitIndirectFieldDecl(IndirectFieldDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+ for (IndirectFieldDecl::chain_iterator I = D->chain_begin(),<br>
+ E = D->chain_end(); I != E; ++I)<br>
+ dumpDeclRef(*I);<br>
+}<br>
+<br>
+void ASTDumper::VisitFunctionDecl(FunctionDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+<br>
+ StorageClass SC = D->getStorageClassAsWritten();<br>
+ if (SC != SC_None)<br>
+ OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);<br>
+ if (D->isInlineSpecified())<br>
+ OS << " inline";<br>
+ if (D->isVirtualAsWritten())<br>
+ OS << " virtual";<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+<br>
+ if (D->isPure())<br>
+ OS << " pure";<br>
+ else if (D->isDeletedAsWritten())<br>
+ OS << " delete";<br>
+<br>
+ if (const FunctionTemplateSpecializationInfo *FTSI =<br>
+ D->getTemplateSpecializationInfo())<br>
+ dumpTemplateArgumentList(*FTSI->TemplateArguments);<br>
+<br>
+ for (llvm::ArrayRef<NamedDecl*>::iterator<br>
+ I = D->getDeclsInPrototypeScope().begin(),<br>
+ E = D->getDeclsInPrototypeScope().end(); I != E; ++I)<br>
+ dumpDecl(*I);<br>
+<br>
+ for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end();<br>
+ I != E; ++I)<br>
+ dumpDecl(*I);<br>
+<br>
+ if (CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D))<br>
+ for (CXXConstructorDecl::init_const_iterator I = C->init_begin(),<br>
+ E = C->init_end(); I != E; ++I)<br>
+ dumpCXXCtorInitializer(*I);<br>
+<br>
+ if (D->doesThisDeclarationHaveABody())<br>
+ dumpStmt(D->getBody());<br>
+}<br>
+<br>
+void ASTDumper::VisitFieldDecl(FieldDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+ if (D->isMutable())<br>
+ OS << " mutable";<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+ if (D->isBitField())<br>
+ dumpStmt(D->getBitWidth());<br>
+ if (Expr *Init = D->getInClassInitializer())<br>
+ dumpStmt(Init);<br>
+}<br>
+<br>
+void ASTDumper::VisitVarDecl(VarDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+ StorageClass SC = D->getStorageClassAsWritten();<br>
+ if (SC != SC_None)<br>
+ OS << ' ' << VarDecl::getStorageClassSpecifierString(SC);<br>
+ if (D->isThreadSpecified())<br>
+ OS << " __thread";<br>
+ if (D->isModulePrivate())<br>
+ OS << " __module_private__";<br>
+ if (D->isNRVOVariable())<br>
+ OS << " nrvo";<br>
+ if (D->hasInit())<br>
+ dumpStmt(D->getInit());<br>
+}<br>
+<br>
+void ASTDumper::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {<br>
+ dumpStmt(D->getAsmString());<br>
+}<br>
+<br>
+void ASTDumper::VisitImportDecl(ImportDecl *D) {<br>
+ OS << ' ' << D->getImportedModule()->getFullModuleName();<br>
+}<br>
+<br>
+//===----------------------------------------------------------------------===//<br>
+// C++ Declarations<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+void ASTDumper::VisitNamespaceDecl(NamespaceDecl *D) {<br>
+ dumpName(D);<br>
+ if (D->isInline())<br>
+ OS << " inline";<br>
+ if (!D->isOriginalNamespace())<br>
+ dumpDeclRef(D->getOriginalNamespace(), "original");<br>
+}<br>
+<br>
+void ASTDumper::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {<br>
+ OS << ' ';<br>
+ dumpBareDeclRef(D->getNominatedNamespace());<br>
+}<br>
+<br>
+void ASTDumper::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getAliasedNamespace());<br>
+}<br>
+<br>
+void ASTDumper::VisitTypeAliasDecl(TypeAliasDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getUnderlyingType());<br>
+}<br>
+<br>
+void ASTDumper::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {<br>
+ dumpName(D);<br>
+ dumpTemplateParameters(D->getTemplateParameters());<br>
+ dumpDecl(D->getTemplatedDecl());<br>
+}<br>
+<br>
+void ASTDumper::VisitCXXRecordDecl(CXXRecordDecl *D) {<br>
+ VisitRecordDecl(D);<br>
+ if (!D->isCompleteDefinition())<br>
+ return;<br>
+<br>
+ for (CXXRecordDecl::base_class_iterator I = D->bases_begin(),<br>
+ E = D->bases_end(); I != E; ++I) {<br>
+ IndentScope Indent(*this);<br>
+ if (I->isVirtual())<br>
+ OS << "virtual ";<br>
+ dumpAccessSpecifier(I->getAccessSpecifier());<br>
+ dumpType(I->getType());<br>
+ if (I->isPackExpansion())<br>
+ OS << "...";<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::VisitStaticAssertDecl(StaticAssertDecl *D) {<br>
+ dumpStmt(D->getAssertExpr());<br>
+ dumpStmt(D->getMessage());<br>
+}<br>
+<br>
+void ASTDumper::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {<br>
+ dumpName(D);<br>
+ dumpTemplateParameters(D->getTemplateParameters());<br>
+ dumpDecl(D->getTemplatedDecl());<br>
+ for (FunctionTemplateDecl::spec_iterator I = D->spec_begin(),<br>
+ E = D->spec_end(); I != E; ++I) {<br>
+ switch (I->getTemplateSpecializationKind()) {<br>
+ case TSK_Undeclared:<br>
+ case TSK_ImplicitInstantiation:<br>
+ case TSK_ExplicitInstantiationDeclaration:<br>
+ case TSK_ExplicitInstantiationDefinition:<br>
+ dumpDecl(*I);<br>
+ break;<br>
+ case TSK_ExplicitSpecialization:<br>
+ dumpDeclRef(*I);<br>
+ break;<br>
+ }<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::VisitClassTemplateDecl(ClassTemplateDecl *D) {<br>
+ dumpName(D);<br>
+ dumpTemplateParameters(D->getTemplateParameters());<br>
+ dumpDecl(D->getTemplatedDecl());<br>
+ for (ClassTemplateDecl::spec_iterator I = D->spec_begin(), E = D->spec_end();<br>
+ I != E; ++I) {<br>
+ switch (I->getTemplateSpecializationKind()) {<br>
+ case TSK_Undeclared:<br>
+ case TSK_ImplicitInstantiation:<br>
+ dumpDecl(*I);<br>
+ break;<br>
+ case TSK_ExplicitSpecialization:<br>
+ case TSK_ExplicitInstantiationDeclaration:<br>
+ case TSK_ExplicitInstantiationDefinition:<br>
+ dumpDeclRef(*I);<br>
+ break;<br>
}<br>
+ }<br>
+}<br>
<br>
- std::string Name = VD->getNameAsString();<br>
- VD->getType().getAsStringInternal(Name,<br>
- PrintingPolicy(VD->getASTContext().getLangOpts()));<br>
- OS << Name;<br>
-<br>
- // If this is a vardecl with an initializer, emit it.<br>
- if (VarDecl *V = dyn_cast<VarDecl>(VD)) {<br>
- if (V->getInit()) {<br>
- OS << " =";<br>
- dumpStmt(V->getInit());<br>
- }<br>
+void ASTDumper::VisitClassTemplateSpecializationDecl(<br>
+ ClassTemplateSpecializationDecl *D) {<br>
+ VisitCXXRecordDecl(D);<br>
+ dumpTemplateArgumentList(D->getTemplateArgs());<br>
+}<br>
+<br>
+void ASTDumper::VisitClassTemplatePartialSpecializationDecl(<br>
+ ClassTemplatePartialSpecializationDecl *D) {<br>
+ VisitClassTemplateSpecializationDecl(D);<br>
+ dumpTemplateParameters(D->getTemplateParameters());<br>
+}<br>
+<br>
+void ASTDumper::VisitClassScopeFunctionSpecializationDecl(<br>
+ ClassScopeFunctionSpecializationDecl *D) {<br>
+ dumpDeclRef(D->getSpecialization());<br>
+ if (D->hasExplicitTemplateArgs())<br>
+ dumpTemplateArgumentListInfo(D->templateArgs());<br>
+}<br>
+<br>
+void ASTDumper::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {<br>
+ if (D->wasDeclaredWithTypename())<br>
+ OS << " typename";<br>
+ else<br>
+ OS << " class";<br>
+ if (D->isParameterPack())<br>
+ OS << " ...";<br>
+ dumpName(D);<br>
+ if (D->hasDefaultArgument())<br>
+ dumpType(D->getDefaultArgument());<br>
+}<br>
+<br>
+void ASTDumper::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {<br>
+ dumpType(D->getType());<br>
+ if (D->isParameterPack())<br>
+ OS << " ...";<br>
+ dumpName(D);<br>
+ if (D->hasDefaultArgument())<br>
+ dumpStmt(D->getDefaultArgument());<br>
+}<br>
+<br>
+void ASTDumper::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) {<br>
+ if (D->isParameterPack())<br>
+ OS << " ...";<br>
+ dumpName(D);<br>
+ dumpTemplateParameters(D->getTemplateParameters());<br>
+ if (D->hasDefaultArgument())<br>
+ dumpTemplateArgumentLoc(D->getDefaultArgument());<br>
+}<br>
+<br>
+void ASTDumper::VisitUsingDecl(UsingDecl *D) {<br>
+ OS << ' ';<br>
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());<br>
+ OS << D->getNameAsString();<br>
+}<br>
+<br>
+void<br>
+ASTDumper::VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D) {<br>
+ OS << ' ';<br>
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());<br>
+ OS << D->getNameAsString();<br>
+}<br>
+<br>
+void ASTDumper::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) {<br>
+ OS << ' ';<br>
+ D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());<br>
+ OS << D->getNameAsString();<br>
+ dumpType(D->getType());<br>
+}<br>
+<br>
+void ASTDumper::VisitUsingShadowDecl(UsingShadowDecl *D) {<br>
+ OS << ' ';<br>
+ dumpBareDeclRef(D->getTargetDecl());<br>
+}<br>
+<br>
+void ASTDumper::VisitLinkageSpecDecl(LinkageSpecDecl *D) {<br>
+ switch (D->getLanguage()) {<br>
+ case LinkageSpecDecl::lang_c: OS << " C"; break;<br>
+ case LinkageSpecDecl::lang_cxx: OS << " C++"; break;<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::VisitAccessSpecDecl(AccessSpecDecl *D) {<br>
+ OS << ' ';<br>
+ dumpAccessSpecifier(D->getAccess());<br>
+}<br>
+<br>
+void ASTDumper::VisitFriendDecl(FriendDecl *D) {<br>
+ if (TypeSourceInfo *T = D->getFriendType())<br>
+ dumpType(T->getType());<br>
+ else<br>
+ dumpDecl(D->getFriendDecl());<br>
+}<br>
+<br>
+//===----------------------------------------------------------------------===//<br>
+// Obj-C Declarations<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+void ASTDumper::VisitObjCIvarDecl(ObjCIvarDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+ if (D->getSynthesize())<br>
+ OS << " synthesize";<br>
+<br>
+ switch (D->getAccessControl()) {<br>
+ case ObjCIvarDecl::None:<br>
+ OS << " none";<br>
+ break;<br>
+ case ObjCIvarDecl::Private:<br>
+ OS << " private";<br>
+ break;<br>
+ case ObjCIvarDecl::Protected:<br>
+ OS << " protected";<br>
+ break;<br>
+ case ObjCIvarDecl::Public:<br>
+ OS << " public";<br>
+ break;<br>
+ case ObjCIvarDecl::Package:<br>
+ OS << " package";<br>
+ break;<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCMethodDecl(ObjCMethodDecl *D) {<br>
+ if (D->isInstanceMethod())<br>
+ OS << " -";<br>
+ else<br>
+ OS << " +";<br>
+ dumpName(D);<br>
+ dumpType(D->getResultType());<br>
+<br>
+ if (D->isThisDeclarationADefinition())<br>
+ dumpDeclContext(D);<br>
+ else {<br>
+ for (ObjCMethodDecl::param_iterator I = D->param_begin(),<br>
+ E = D->param_end(); I != E; ++I) {<br>
+ dumpDecl(*I);<br>
}<br>
- OS << '"';<br>
- } else if (TagDecl *TD = dyn_cast<TagDecl>(D)) {<br>
- // print a free standing tag decl (e.g. "struct x;").<br>
- const char *tagname;<br>
- if (const IdentifierInfo *II = TD->getIdentifier())<br>
- tagname = II->getNameStart();<br>
- else<br>
- tagname = "<anonymous>";<br>
- OS << '"' << TD->getKindName() << ' ' << tagname << ";\"";<br>
- // FIXME: print tag bodies.<br>
- } else if (UsingDirectiveDecl *UD = dyn_cast<UsingDirectiveDecl>(D)) {<br>
- // print using-directive decl (e.g. "using namespace x;")<br>
- const char *ns;<br>
- if (const IdentifierInfo *II = UD->getNominatedNamespace()->getIdentifier())<br>
- ns = II->getNameStart();<br>
- else<br>
- ns = "<anonymous>";<br>
- OS << '"' << UD->getDeclKindName() << ns << ";\"";<br>
- } else if (UsingDecl *UD = dyn_cast<UsingDecl>(D)) {<br>
- // print using decl (e.g. "using std::string;")<br>
- const char *tn = UD->isTypeName() ? "typename " : "";<br>
- OS << '"' << UD->getDeclKindName() << tn;<br>
- UD->getQualifier()->print(OS,<br>
- PrintingPolicy(UD->getASTContext().getLangOpts()));<br>
- OS << ";\"";<br>
- } else if (LabelDecl *LD = dyn_cast<LabelDecl>(D)) {<br>
- OS << "label " << *LD;<br>
- } else if (StaticAssertDecl *SAD = dyn_cast<StaticAssertDecl>(D)) {<br>
- OS << "\"static_assert(";<br>
- dumpStmt(SAD->getAssertExpr());<br>
- OS << ",";<br>
- dumpStmt(SAD->getMessage());<br>
- OS << ");\"";<br>
- } else {<br>
- llvm_unreachable("Unexpected decl");<br>
}<br>
+<br>
+ if (D->isVariadic()) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "...";<br>
+ }<br>
+<br>
+ if (D->hasBody())<br>
+ dumpStmt(D->getBody());<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCCategoryDecl(ObjCCategoryDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getClassInterface());<br>
+ dumpDeclRef(D->getImplementation());<br>
+ for (ObjCCategoryDecl::protocol_iterator I = D->protocol_begin(),<br>
+ E = D->protocol_end(); I != E; ++I)<br>
+ dumpDeclRef(*I);<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getClassInterface());<br>
+ dumpDeclRef(D->getCategoryDecl());<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCProtocolDecl(ObjCProtocolDecl *D) {<br>
+ dumpName(D);<br>
+ for (ObjCProtocolDecl::protocol_iterator I = D->protocol_begin(),<br>
+ E = D->protocol_end(); I != E; ++I)<br>
+ dumpDeclRef(*I);<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getSuperClass(), "super");<br>
+ dumpDeclRef(D->getImplementation());<br>
+ for (ObjCInterfaceDecl::protocol_iterator I = D->protocol_begin(),<br>
+ E = D->protocol_end(); I != E; ++I)<br>
+ dumpDeclRef(*I);<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getSuperClass(), "super");<br>
+ dumpDeclRef(D->getClassInterface());<br>
+ for (ObjCImplementationDecl::init_iterator I = D->init_begin(),<br>
+ E = D->init_end(); I != E; ++I)<br>
+ dumpCXXCtorInitializer(*I);<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D) {<br>
+ dumpName(D);<br>
+ dumpDeclRef(D->getClassInterface());<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {<br>
+ dumpName(D);<br>
+ dumpType(D->getType());<br>
+<br>
+ if (D->getPropertyImplementation() == ObjCPropertyDecl::Required)<br>
+ OS << " required";<br>
+ else if (D->getPropertyImplementation() == ObjCPropertyDecl::Optional)<br>
+ OS << " optional";<br>
+<br>
+ ObjCPropertyDecl::PropertyAttributeKind Attrs = D->getPropertyAttributes();<br>
+ if (Attrs != ObjCPropertyDecl::OBJC_PR_noattr) {<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_readonly)<br>
+ OS << " readonly";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_assign)<br>
+ OS << " assign";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_readwrite)<br>
+ OS << " readwrite";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_retain)<br>
+ OS << " retain";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_copy)<br>
+ OS << " copy";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_nonatomic)<br>
+ OS << " nonatomic";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_atomic)<br>
+ OS << " atomic";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_weak)<br>
+ OS << " weak";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_strong)<br>
+ OS << " strong";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained)<br>
+ OS << " unsafe_unretained";<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_getter)<br>
+ dumpDeclRef(D->getGetterMethodDecl(), "getter");<br>
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_setter)<br>
+ dumpDeclRef(D->getSetterMethodDecl(), "setter");<br>
+ }<br>
+}<br>
+<br>
+void ASTDumper::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {<br>
+ dumpName(D->getPropertyDecl());<br>
+ if (D->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize)<br>
+ OS << " synthesize";<br>
+ else<br>
+ OS << " dynamic";<br>
+ dumpDeclRef(D->getPropertyDecl());<br>
+ dumpDeclRef(D->getPropertyIvarDecl());<br>
+}<br>
+<br>
+void ASTDumper::VisitBlockDecl(BlockDecl *D) {<br>
+ for (BlockDecl::param_iterator I = D->param_begin(), E = D->param_end();<br>
+ I != E; ++I)<br>
+ dumpDecl(*I);<br>
+<br>
+ if (D->isVariadic()) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "...";<br>
+ }<br>
+<br>
+ if (D->capturesCXXThis()) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "capture this";<br>
+ }<br>
+ for (BlockDecl::capture_iterator I = D->capture_begin(),<br>
+ E = D->capture_end(); I != E; ++I) {<br>
+ IndentScope Indent(*this);<br>
+ OS << "capture";<br>
+ if (I->isByRef())<br>
+ OS << " byref";<br>
+ if (I->isNested())<br>
+ OS << " nested";<br>
+ if (I->getVariable()) {<br>
+ OS << ' ';<br>
+ dumpBareDeclRef(I->getVariable());<br>
+ }<br>
+ if (I->hasCopyExpr())<br>
+ dumpStmt(I->getCopyExpr());<br>
+ }<br>
+<br>
+ dumpStmt(D->getBody());<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
@@ -300,25 +942,22 @@<br>
return;<br>
}<br>
<br>
- Visit(S);<br>
+ StmtVisitor<ASTDumper>::Visit(S);<br>
for (Stmt::child_range CI = S->children(); CI; ++CI)<br>
dumpStmt(*CI);<br>
}<br>
<br>
void ASTDumper::VisitStmt(Stmt *Node) {<br>
- OS << Node->getStmtClassName() << " " << (const void *)Node;<br>
- dumpSourceRange(Node);<br>
+ OS << Node->getStmtClassName();<br>
+ dumpPointer(Node);<br>
+ dumpSourceRange(Node->getSourceRange());<br>
}<br>
<br>
void ASTDumper::VisitDeclStmt(DeclStmt *Node) {<br>
VisitStmt(Node);<br>
- for (DeclStmt::decl_iterator DI = Node->decl_begin(), DE = Node->decl_end();<br>
- DI != DE; ++DI) {<br>
- IndentScope Indent(*this);<br>
- Decl *D = *DI;<br>
- OS << (void*) D << " ";<br>
- dumpDecl(D);<br>
- }<br>
+ for (DeclStmt::decl_iterator I = Node->decl_begin(), E = Node->decl_end();<br>
+ I != E; ++I)<br>
+ dumpDecl(*I);<br>
}<br>
<br>
void ASTDumper::VisitLabelStmt(LabelStmt *Node) {<br>
@@ -328,8 +967,8 @@<br>
<br>
void ASTDumper::VisitGotoStmt(GotoStmt *Node) {<br>
VisitStmt(Node);<br>
- OS << " '" << Node->getLabel()->getName()<br>
- << "':" << (void*)Node->getLabel();<br>
+ OS << " '" << Node->getLabel()->getName() << "'";<br>
+ dumpPointer(Node->getLabel());<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
@@ -338,7 +977,6 @@<br>
<br>
void ASTDumper::VisitExpr(Expr *Node) {<br>
VisitStmt(Node);<br>
- OS << ' ';<br>
dumpType(Node->getType());<br>
<br>
switch (Node->getValueKind()) {<br>
@@ -405,10 +1043,10 @@<br>
VisitExpr(Node);<br>
<br>
OS << " ";<br>
- dumpDeclRef(Node->getDecl());<br>
+ dumpBareDeclRef(Node->getDecl());<br>
if (Node->getDecl() != Node->getFoundDecl()) {<br>
OS << " (";<br>
- dumpDeclRef(Node->getFoundDecl());<br>
+ dumpBareDeclRef(Node->getFoundDecl());<br>
OS << ")";<br>
}<br>
}<br>
@@ -425,15 +1063,15 @@<br>
if (I == E)<br>
OS << " empty";<br>
for (; I != E; ++I)<br>
- OS << " " << (void*) *I;<br>
+ dumpPointer(*I);<br>
}<br>
<br>
void ASTDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) {<br>
VisitExpr(Node);<br>
<br>
OS << " " << Node->getDecl()->getDeclKindName()<br>
- << "Decl='" << *Node->getDecl()<br>
- << "' " << (void*)Node->getDecl();<br>
+ << "Decl='" << *Node->getDecl() << "'";<br>
+ dumpPointer(Node->getDecl());<br>
if (Node->isFreeIvar())<br>
OS << " isFreeIvar";<br>
}<br>
@@ -482,13 +1120,13 @@<br>
VisitExpr(Node);<br>
switch(Node->getKind()) {<br>
case UETT_SizeOf:<br>
- OS << " sizeof ";<br>
+ OS << " sizeof";<br>
break;<br>
case UETT_AlignOf:<br>
- OS << " alignof ";<br>
+ OS << " alignof";<br>
break;<br>
case UETT_VecStep:<br>
- OS << " vec_step ";<br>
+ OS << " vec_step";<br>
break;<br>
}<br>
if (Node->isArgumentType())<br>
@@ -497,9 +1135,8 @@<br>
<br>
void ASTDumper::VisitMemberExpr(MemberExpr *Node) {<br>
VisitExpr(Node);<br>
- OS << " " << (Node->isArrow() ? "->" : ".")<br>
- << *Node->getMemberDecl() << ' '<br>
- << (void*)Node->getMemberDecl();<br>
+ OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();<br>
+ dumpPointer(Node->getMemberDecl());<br>
}<br>
<br>
void ASTDumper::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) {<br>
@@ -516,36 +1153,14 @@<br>
VisitExpr(Node);<br>
OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())<br>
<< "' ComputeLHSTy=";<br>
- dumpType(Node->getComputationLHSType());<br>
+ dumpBareType(Node->getComputationLHSType());<br>
OS << " ComputeResultTy=";<br>
- dumpType(Node->getComputationResultType());<br>
+ dumpBareType(Node->getComputationResultType());<br>
}<br>
<br>
void ASTDumper::VisitBlockExpr(BlockExpr *Node) {<br>
VisitExpr(Node);<br>
-<br>
- BlockDecl *block = Node->getBlockDecl();<br>
- OS << " decl=" << block;<br>
-<br>
- if (block->capturesCXXThis()) {<br>
- IndentScope Indent(*this);<br>
- OS << "capture this";<br>
- }<br>
- for (BlockDecl::capture_iterator<br>
- i = block->capture_begin(), e = block->capture_end(); i != e; ++i) {<br>
- IndentScope Indent(*this);<br>
- OS << "capture ";<br>
- if (i->isByRef())<br>
- OS << "byref ";<br>
- if (i->isNested())<br>
- OS << "nested ";<br>
- if (i->getVariable())<br>
- dumpDeclRef(i->getVariable());<br>
- if (i->hasCopyExpr())<br>
- dumpStmt(i->getCopyExpr());<br>
- }<br>
-<br>
- dumpStmt(block->getBody());<br>
+ dumpDecl(Node->getBlockDecl());<br>
}<br>
<br>
void ASTDumper::VisitOpaqueValueExpr(OpaqueValueExpr *Node) {<br>
@@ -559,8 +1174,8 @@<br>
<br>
void ASTDumper::VisitAddrLabelExpr(AddrLabelExpr *Node) {<br>
VisitExpr(Node);<br>
- OS << " " << Node->getLabel()->getName()<br>
- << " " << (void*)Node->getLabel();<br>
+ OS << " " << Node->getLabel()->getName();<br>
+ dumpPointer(Node->getLabel());<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
@@ -610,15 +1225,14 @@<br>
<br>
void ASTDumper::VisitExprWithCleanups(ExprWithCleanups *Node) {<br>
VisitExpr(Node);<br>
- for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i) {<br>
- IndentScope Indent(*this);<br>
- OS << "cleanup ";<br>
- dumpDeclRef(Node->getObject(i));<br>
- }<br>
+ for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)<br>
+ dumpDeclRef(Node->getObject(i), "cleanup");<br>
}<br>
<br>
void ASTDumper::dumpCXXTemporary(CXXTemporary *Temporary) {<br>
- OS << "(CXXTemporary " << (void *)Temporary << ")";<br>
+ OS << "(CXXTemporary";<br>
+ dumpPointer(Temporary);<br>
+ OS << ")";<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
@@ -634,7 +1248,7 @@<br>
<br>
case ObjCMessageExpr::Class:<br>
OS << " class=";<br>
- dumpType(Node->getClassReceiver());<br>
+ dumpBareType(Node->getClassReceiver());<br>
break;<br>
<br>
case ObjCMessageExpr::SuperInstance:<br>
@@ -654,17 +1268,14 @@<br>
<br>
void ASTDumper::VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node) {<br>
VisitStmt(Node);<br>
- if (VarDecl *CatchParam = Node->getCatchParamDecl()) {<br>
- OS << " catch parm = ";<br>
+ if (VarDecl *CatchParam = Node->getCatchParamDecl())<br>
dumpDecl(CatchParam);<br>
- } else {<br>
+ else<br>
OS << " catch all";<br>
- }<br>
}<br>
<br>
void ASTDumper::VisitObjCEncodeExpr(ObjCEncodeExpr *Node) {<br>
VisitExpr(Node);<br>
- OS << " ";<br>
dumpType(Node->getEncodedType());<br>
}<br>
<br>
@@ -738,6 +1349,19 @@<br>
}<br>
<br>
//===----------------------------------------------------------------------===//<br>
+// Decl method implementations<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+void Decl::dump() const {<br>
+ dump(llvm::errs());<br>
+}<br>
+<br>
+void Decl::dump(raw_ostream &OS) const {<br>
+ ASTDumper P(&getASTContext().getSourceManager(), OS);<br>
+ P.dumpDecl(const_cast<Decl*>(this));<br>
+}<br>
+<br>
+//===----------------------------------------------------------------------===//<br>
// Stmt method implementations<br>
//===----------------------------------------------------------------------===//<br>
<br>
<br>
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Wed Dec 19 20:09:13 2012<br>
@@ -7,7 +7,7 @@<br>
//<br>
//===----------------------------------------------------------------------===//<br>
//<br>
-// This file implements the Decl::dump method, which pretty print the<br>
+// This file implements the Decl::print method, which pretty prints the<br>
// AST back out to C/Objective-C/C++/Objective-C++ code.<br>
//<br>
//===----------------------------------------------------------------------===//<br>
@@ -176,16 +176,6 @@<br>
Printer.VisitDeclContext(const_cast<DeclContext *>(this), /*Indent=*/false);<br>
}<br>
<br>
-void Decl::dump() const {<br>
- dump(llvm::errs());<br>
-}<br>
-<br>
-void Decl::dump(raw_ostream &Out) const {<br>
- PrintingPolicy Policy = getASTContext().getPrintingPolicy();<br>
- Policy.DumpSourceManager = &getASTContext().getSourceManager();<br>
- print(Out, Policy, /*Indentation*/ 0, /*PrintInstantiation*/ true);<br>
-}<br>
-<br>
raw_ostream& DeclPrinter::Indent(unsigned Indentation) {<br>
for (unsigned i = 0; i != Indentation; ++i)<br>
Out << " ";<br>
@@ -242,18 +232,18 @@<br>
if (isa<ObjCIvarDecl>(*D))<br>
continue;<br>
<br>
- if (!Policy.DumpSourceManager) {<br>
- // Skip over implicit declarations in pretty-printing mode.<br>
- if (D->isImplicit()) continue;<br>
- // FIXME: Ugly hack so we don't pretty-print the builtin declaration<br>
- // of __builtin_va_list or __[u]int128_t. There should be some other way<br>
- // to check that.<br>
- if (NamedDecl *ND = dyn_cast<NamedDecl>(*D)) {<br>
- if (IdentifierInfo *II = ND->getIdentifier()) {<br>
- if (II->isStr("__builtin_va_list") ||<br>
- II->isStr("__int128_t") || II->isStr("__uint128_t"))<br>
- continue;<br>
- }<br>
+ // Skip over implicit declarations in pretty-printing mode.<br>
+ if (D->isImplicit())<br>
+ continue;<br>
+<br>
+ // FIXME: Ugly hack so we don't pretty-print the builtin declaration<br>
+ // of __builtin_va_list or __[u]int128_t. There should be some other way<br>
+ // to check that.<br>
+ if (NamedDecl *ND = dyn_cast<NamedDecl>(*D)) {<br>
+ if (IdentifierInfo *II = ND->getIdentifier()) {<br>
+ if (II->isStr("__builtin_va_list") ||<br>
+ II->isStr("__int128_t") || II->isStr("__uint128_t"))<br>
+ continue;<br>
}<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Wed Dec 19 20:09:13 2012<br>
@@ -1875,11 +1875,6 @@<br>
return;<br>
}<br>
<br>
- if (Policy.DumpSourceManager) {<br>
- dump(OS, *Policy.DumpSourceManager);<br>
- return;<br>
- }<br>
-<br>
StmtPrinter P(OS, Helper, Policy, Indentation);<br>
P.Visit(const_cast<Stmt*>(this));<br>
}<br>
<br>
Modified: cfe/trunk/lib/AST/TemplateName.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateName.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateName.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/TemplateName.cpp (original)<br>
+++ cfe/trunk/lib/AST/TemplateName.cpp Wed Dec 19 20:09:13 2012<br>
@@ -168,9 +168,13 @@<br>
return DB << NameStr;<br>
}<br>
<br>
-void TemplateName::dump() const {<br>
+void TemplateName::dump(raw_ostream &OS) const {<br>
LangOptions LO; // FIXME!<br>
LO.CPlusPlus = true;<br>
LO.Bool = true;<br>
- print(llvm::errs(), PrintingPolicy(LO));<br>
+ print(OS, PrintingPolicy(LO));<br>
+}<br>
+<br>
+void TemplateName::dump() const {<br>
+ dump(llvm::errs());<br>
}<br>
<br>
Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp (original)<br>
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp Wed Dec 19 20:09:13 2012<br>
@@ -3,10 +3,10 @@<br>
// CHECK: example0<br>
void example0() {<br>
double d = 2.0;<br>
- // CHECK: double &rd =<br>
+ // CHECK: VarDecl{{.*}}rd 'double &'<br>
// CHECK-NEXT: DeclRefExpr<br>
double &rd = d;<br>
- // CHECK: const double &rcd =<br>
+ // CHECK: VarDecl{{.*}}rcd 'const double &'<br>
// CHECK-NEXT: ImplicitCastExpr{{.*}}'const double' lvalue <NoOp><br>
const double &rcd = d;<br>
}<br>
@@ -16,10 +16,10 @@<br>
<br>
// CHECK: example1<br>
void example1() {<br>
- // CHECK: A &ra =<br>
+ // CHECK: VarDecl{{.*}}ra 'struct A &'<br>
// CHECK: ImplicitCastExpr{{.*}}'struct A' lvalue <DerivedToBase (A)><br>
A &ra = b;<br>
- // CHECK: const A &rca =<br>
+ // CHECK: VarDecl{{.*}}rca 'const struct A &'<br>
// CHECK: ImplicitCastExpr{{.*}}'const struct A' lvalue <NoOp><br>
// CHECK: ImplicitCastExpr{{.*}}'struct A' lvalue <DerivedToBase (A)><br>
const A& rca = b;<br>
@@ -33,12 +33,12 @@<br>
<br>
// CHECK: example2<br>
void example2() {<br>
- // CHECK: const A &rca =<br>
+ // CHECK: VarDecl{{.*}}rca 'const struct A &'<br>
// CHECK: ImplicitCastExpr{{.*}}'const struct A' <NoOp><br>
// CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)><br>
// CHECK: CallExpr{{.*}}B<br>
const A &rca = f();<br>
- // CHECK: const A &r =<br>
+ // CHECK: VarDecl{{.*}}r 'const struct A &'<br>
// CHECK: ImplicitCastExpr{{.*}}'const struct A' <NoOp><br>
// CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)><br>
// CHECK: CXXMemberCallExpr{{.*}}'struct B'<br>
@@ -47,7 +47,7 @@<br>
<br>
// CHECK: example3<br>
void example3() {<br>
- // CHECK: const double &rcd2 =<br>
+ // CHECK: VarDecl{{.*}}rcd2 'const double &'<br>
// CHECK: ImplicitCastExpr{{.*}} <IntegralToFloating><br>
const double& rcd2 = 2;<br>
}<br>
<br>
Modified: cfe/trunk/test/CodeGen/bitfield-2.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/bitfield-2.c?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/bitfield-2.c?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGen/bitfield-2.c (original)<br>
+++ cfe/trunk/test/CodeGen/bitfield-2.c Wed Dec 19 20:09:13 2012<br>
@@ -9,7 +9,7 @@<br>
// PR6176<br>
<br>
// CHECK-RECORD: *** Dumping IRgen Record Layout<br>
-// CHECK-RECORD: Record: struct s0<br>
+// CHECK-RECORD: Record: (RecordDecl{{.*}}s0<br>
// CHECK-RECORD: Layout: <CGRecordLayout<br>
// CHECK-RECORD: LLVMType:%struct.s0 = type <{ [3 x i8] }><br>
// CHECK-RECORD: IsZeroInitializable:1<br>
@@ -49,7 +49,7 @@<br>
// PR5591<br>
<br>
// CHECK-RECORD: *** Dumping IRgen Record Layout<br>
-// CHECK-RECORD: Record: struct s1<br>
+// CHECK-RECORD: Record: (RecordDecl{{.*}}s1<br>
// CHECK-RECORD: Layout: <CGRecordLayout<br>
// CHECK-RECORD: LLVMType:%struct.s1 = type <{ [3 x i8] }><br>
// CHECK-RECORD: IsZeroInitializable:1<br>
@@ -97,7 +97,7 @@<br>
// PR5567<br>
<br>
// CHECK-RECORD: *** Dumping IRgen Record Layout<br>
-// CHECK-RECORD: Record: union u2<br>
+// CHECK-RECORD: Record: (RecordDecl{{.*}}u2<br>
// CHECK-RECORD: Layout: <CGRecordLayout<br>
// CHECK-RECORD: LLVMType:%union.u2 = type <{ i8 }><br>
// CHECK-RECORD: IsZeroInitializable:1<br>
@@ -269,7 +269,7 @@<br>
// Check that we compute the best alignment possible for each access.<br>
//<br>
// CHECK-RECORD: *** Dumping IRgen Record Layout<br>
-// CHECK-RECORD: Record: struct s7<br>
+// CHECK-RECORD: Record: (RecordDecl{{.*}}s7<br>
// CHECK-RECORD: Layout: <CGRecordLayout<br>
// CHECK-RECORD: LLVMType:%struct.s7 = type { i32, i32, i32, i8, [3 x i8], [4 x i8], [12 x i8] }<br>
// CHECK-RECORD: IsZeroInitializable:1<br>
<br>
Added: cfe/trunk/test/Misc/ast-dump-decl.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.c?rev=170634&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.c?rev=170634&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-decl.c (added)<br>
+++ cfe/trunk/test/Misc/ast-dump-decl.c Wed Dec 19 20:09:13 2012<br>
@@ -0,0 +1,152 @@<br>
+// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s<br>
+// RUN: %clang_cc1 -ast-dump %s | FileCheck -check-prefix CHECK-TU -strict-whitespace %s<br>
+<br>
+int TestLocation;<br>
+// CHECK: VarDecl 0x{{[^ ]*}} <{{.*}}:4:1, col:5> TestLocation<br>
+<br>
+struct TestIndent {<br>
+ int x;<br>
+};<br>
+// CHECK: {{^\(RecordDecl.*TestIndent[^()]*$}}<br>
+// CHECK-NEXT: {{^ \(FieldDecl.*x[^()]*\)\)$}}<br>
+<br>
+struct TestChildren {<br>
+ int x;<br>
+ struct y {<br>
+ int z;<br>
+ };<br>
+};<br>
+// CHECK: RecordDecl{{.*}}TestChildren<br>
+// CHECK-NEXT: FieldDecl{{.*}}x<br>
+// CHECK-NEXT: RecordDecl{{.*}}y<br>
+// CHECK-NEXT: FieldDecl{{.*}}z<br>
+<br>
+// CHECK-TU: TranslationUnitDecl<br>
+<br>
+void testLabelDecl() {<br>
+ __label__ TestLabelDecl;<br>
+ TestLabelDecl: goto TestLabelDecl;<br>
+}<br>
+// CHECK: LabelDecl{{.*}} TestLabelDecl<br>
+<br>
+typedef int TestTypedefDecl;<br>
+// CHECK: TypedefDecl{{.*}} TestTypedefDecl 'int'<br>
+<br>
+__module_private__ typedef int TestTypedefDeclPrivate;<br>
+// CHECK: TypedefDecl{{.*}} TestTypedefDeclPrivate 'int' __module_private__<br>
+<br>
+enum TestEnumDecl {<br>
+ testEnumDecl<br>
+};<br>
+// CHECK: EnumDecl{{.*}} TestEnumDecl<br>
+// CHECK-NEXT: EnumConstantDecl{{.*}} testEnumDecl<br>
+<br>
+struct TestEnumDeclAnon {<br>
+ enum {<br>
+ testEnumDeclAnon<br>
+ } e;<br>
+};<br>
+// CHECK: RecordDecl{{.*}} TestEnumDeclAnon<br>
+// CHECK-NEXT: EnumDecl{{.*>$}}<br>
+<br>
+enum TestEnumDeclForward;<br>
+// CHECK: EnumDecl{{.*}} TestEnumDeclForward<br>
+<br>
+__module_private__ enum TestEnumDeclPrivate;<br>
+// CHECK: EnumDecl{{.*}} TestEnumDeclPrivate __module_private__<br>
+<br>
+struct TestRecordDecl {<br>
+ int i;<br>
+};<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDecl<br>
+// CHECK-NEXT: FieldDecl<br>
+<br>
+struct TestRecordDeclEmpty {<br>
+};<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDeclEmpty<br>
+<br>
+struct TestRecordDeclAnon1 {<br>
+ struct {<br>
+ } testRecordDeclAnon1;<br>
+};<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon1<br>
+// CHECK-NEXT: RecordDecl{{.*}} struct<br>
+<br>
+struct TestRecordDeclAnon2 {<br>
+ struct {<br>
+ };<br>
+};<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon2<br>
+// CHECK-NEXT: RecordDecl{{.*}} struct<br>
+<br>
+struct TestRecordDeclForward;<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDeclForward<br>
+<br>
+__module_private__ struct TestRecordDeclPrivate;<br>
+// CHECK: RecordDecl{{.*}} struct TestRecordDeclPrivate __module_private__<br>
+<br>
+enum testEnumConstantDecl {<br>
+ TestEnumConstantDecl,<br>
+ TestEnumConstantDeclInit = 1<br>
+};<br>
+// CHECK: EnumConstantDecl{{.*}} TestEnumConstantDecl 'int'<br>
+// CHECK: EnumConstantDecl{{.*}} TestEnumConstantDeclInit 'int'<br>
+// CHECK-NEXT: IntegerLiteral<br>
+<br>
+struct testIndirectFieldDecl {<br>
+ struct {<br>
+ int TestIndirectFieldDecl;<br>
+ };<br>
+};<br>
+// CHECK: IndirectFieldDecl{{.*}} TestIndirectFieldDecl 'int'<br>
+// CHECK-NEXT: Field{{.*}} ''<br>
+// CHECK-NEXT: Field{{.*}} 'TestIndirectFieldDecl'<br>
+<br>
+int TestFunctionDecl(int x, enum { e } y) {<br>
+ return x;<br>
+}<br>
+// CHECK: FunctionDecl{{.*}} TestFunctionDecl 'int (int, enum {{.*}})'<br>
+// CHECK-NEXT: EnumDecl<br>
+// CHECK-NEXT: EnumConstantDecl{{.*}} e<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} x<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} y<br>
+// CHECK-NEXT: CompoundStmt<br>
+<br>
+int TestFunctionDeclProto(int x);<br>
+// CHECK: FunctionDecl{{.*}} TestFunctionDeclProto 'int (int)'<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} x<br>
+<br>
+extern int TestFunctionDeclSC();<br>
+// CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int ()' extern<br>
+<br>
+inline int TestFunctionDeclInline();<br>
+// CHECK: FunctionDecl{{.*}} TestFunctionDeclInline 'int ()' inline<br>
+<br>
+struct testFieldDecl {<br>
+ int TestFieldDecl;<br>
+ int TestFieldDeclWidth : 1;<br>
+ __module_private__ int TestFieldDeclPrivate;<br>
+};<br>
+// CHECK: FieldDecl{{.*}} TestFieldDecl 'int'<br>
+// CHECK: FieldDecl{{.*}} TestFieldDeclWidth 'int'<br>
+// CHECK-NEXT: IntegerLiteral<br>
+// CHECK: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__<br>
+<br>
+int TestVarDecl;<br>
+// CHECK: VarDecl{{.*}} TestVarDecl 'int'<br>
+<br>
+extern int TestVarDeclSC;<br>
+// CHECK: VarDecl{{.*}} TestVarDeclSC 'int' extern<br>
+<br>
+__thread int TestVarDeclThread;<br>
+// CHECK: VarDecl{{.*}} TestVarDeclThread 'int' __thread<br>
+<br>
+__module_private__ int TestVarDeclPrivate;<br>
+// CHECK: VarDecl{{.*}} TestVarDeclPrivate 'int' __module_private__<br>
+<br>
+int TestVarDeclInit = 0;<br>
+// CHECK: VarDecl{{.*}} TestVarDeclInit 'int'<br>
+// CHECK-NEXT: IntegerLiteral<br>
+<br>
+void testParmVarDecl(int TestParmVarDecl);<br>
+// CHECK: ParmVarDecl{{.*}} TestParmVarDecl 'int'<br>
<br>
Added: cfe/trunk/test/Misc/ast-dump-decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.cpp?rev=170634&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.cpp?rev=170634&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-decl.cpp (added)<br>
+++ cfe/trunk/test/Misc/ast-dump-decl.cpp Wed Dec 19 20:09:13 2012<br>
@@ -0,0 +1,405 @@<br>
+// RUN: %clang_cc1 -std=c++11 -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s<br>
+<br>
+class testEnumDecl {<br>
+ enum class TestEnumDeclScoped;<br>
+ enum TestEnumDeclFixed : int;<br>
+};<br>
+// CHECK: EnumDecl{{.*}} class TestEnumDeclScoped 'int'<br>
+// CHECK: EnumDecl{{.*}} TestEnumDeclFixed 'int'<br>
+<br>
+class testFieldDecl {<br>
+ int TestFieldDeclInit = 0;<br>
+};<br>
+// CHECK: FieldDecl{{.*}} TestFieldDeclInit 'int'<br>
+// CHECK-NEXT: IntegerLiteral<br>
+<br>
+namespace testVarDeclNRVO {<br>
+ class A { };<br>
+ A foo() {<br>
+ A TestVarDeclNRVO;<br>
+ return TestVarDeclNRVO;<br>
+ }<br>
+}<br>
+// CHECK: VarDecl{{.*}} TestVarDeclNRVO 'class testVarDeclNRVO::A' nrvo<br>
+<br>
+void testParmVarDeclInit(int TestParmVarDeclInit = 0);<br>
+// CHECK: ParmVarDecl{{.*}} TestParmVarDeclInit 'int'<br>
+// CHECK-NEXT: IntegerLiteral{{.*}}<br>
+<br>
+namespace TestNamespaceDecl {<br>
+ int i;<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestNamespaceDecl<br>
+// CHECK-NEXT: VarDecl<br>
+<br>
+namespace TestNamespaceDecl {<br>
+ int j;<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestNamespaceDecl<br>
+// CHECK-NEXT: original Namespace<br>
+// CHECK-NEXT: VarDecl<br>
+<br>
+inline namespace TestNamespaceDeclInline {<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestNamespaceDeclInline inline<br>
+<br>
+namespace testUsingDirectiveDecl {<br>
+ namespace A {<br>
+ }<br>
+}<br>
+namespace TestUsingDirectiveDecl {<br>
+ using namespace testUsingDirectiveDecl::A;<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestUsingDirectiveDecl<br>
+// CHECK-NEXT: UsingDirectiveDecl{{.*}} Namespace{{.*}} 'A'<br>
+<br>
+namespace testNamespaceAlias {<br>
+ namespace A {<br>
+ }<br>
+}<br>
+namespace TestNamespaceAlias = testNamespaceAlias::A;<br>
+// CHECK: NamespaceAliasDecl{{.*}} TestNamespaceAlias<br>
+// CHECK-NEXT: Namespace{{.*}} 'A'<br>
+<br>
+using TestTypeAliasDecl = int;<br>
+// CHECK: TypeAliasDecl{{.*}} TestTypeAliasDecl 'int'<br>
+<br>
+namespace testTypeAliasTemplateDecl {<br>
+ template<typename T> class A;<br>
+ template<typename T> using TestTypeAliasTemplateDecl = A<T>;<br>
+}<br>
+// CHECK: TypeAliasTemplateDecl{{.*}} TestTypeAliasTemplateDecl<br>
+// CHECK-NEXT: TemplateTypeParmDecl<br>
+// CHECK-NEXT: TypeAliasDecl{{.*}} TestTypeAliasTemplateDecl 'A<T>'<br>
+<br>
+namespace testCXXRecordDecl {<br>
+ class A { };<br>
+ class B { };<br>
+ class TestCXXRecordDecl : virtual A, public B {<br>
+ int i;<br>
+ };<br>
+}<br>
+// CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDecl<br>
+// CHECK-NEXT: virtual private 'class testCXXRecordDecl::A'<br>
+// CHECK-NEXT: public 'class testCXXRecordDecl::B'<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDecl<br>
+// CHECK-NEXT: FieldDecl<br>
+<br>
+template<class...T><br>
+class TestCXXRecordDeclPack : public T... {<br>
+};<br>
+// CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack<br>
+// CHECK-NEXT: public 'T'...<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack<br>
+<br>
+__module_private__ class TestCXXRecordDeclPrivate;<br>
+// CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPrivate __module_private__<br>
+<br>
+class testCXXMethodDecl {<br>
+ __module_private__ void TestCXXMethodDeclPrivate();<br>
+ virtual void TestCXXMethodDeclPure() = 0;<br>
+ void TestCXXMethodDeclDelete() = delete;<br>
+ void TestCXXMethodDeclThrow() throw();<br>
+ void TestCXXMethodDeclThrowType() throw(int);<br>
+};<br>
+// CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPrivate 'void (void)' __module_private__<br>
+// CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPure 'void (void)' virtual pure<br>
+// CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclDelete 'void (void)' delete<br>
+// CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrow 'void (void) throw()'<br>
+// CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrowType 'void (void) throw(int)'<br>
+<br>
+namespace testCXXConstructorDecl {<br>
+ class A { };<br>
+ class TestCXXConstructorDecl : public A {<br>
+ int I;<br>
+ TestCXXConstructorDecl(A &a, int i) : A(a), I(i) { }<br>
+ };<br>
+}<br>
+// CHECK: CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}'<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} a<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} i<br>
+// CHECK-NEXT: CXXCtorInitializer{{.*}}A<br>
+// CHECK-NEXT: Expr<br>
+// CHECK: CXXCtorInitializer{{.*}}I<br>
+// CHECK-NEXT: Expr<br>
+// CHECK: CompoundStmt<br>
+<br>
+class TestCXXDestructorDecl {<br>
+ ~TestCXXDestructorDecl() { }<br>
+};<br>
+// CHECK: CXXDestructorDecl{{.*}} ~TestCXXDestructorDecl 'void (void) noexcept'<br>
+// CHECK-NEXT: CompoundStmt<br>
+<br>
+class TestCXXConversionDecl {<br>
+ operator int() { return 0; }<br>
+};<br>
+// CHECK: CXXConversionDecl{{.*}} operator int 'int (void)'<br>
+// CHECK-NEXT: CompoundStmt<br>
+<br>
+namespace TestStaticAssertDecl {<br>
+ static_assert(true, "msg");<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestStaticAssertDecl<br>
+// CHECK-NEXT: StaticAssertDecl{{.*>$}}<br>
+// CHECK-NEXT: CXXBoolLiteralExpr<br>
+// CHECK-NEXT: StringLiteral<br>
+<br>
+namespace testFunctionTemplateDecl {<br>
+ class A { };<br>
+ class B { };<br>
+ class C { };<br>
+ class D { };<br>
+ template<typename T> void TestFunctionTemplate(T) { }<br>
+<br>
+ // implicit instantiation<br>
+ void bar(A a) { TestFunctionTemplate(a); }<br>
+<br>
+ // explicit specialization<br>
+ template<> void TestFunctionTemplate(B);<br>
+<br>
+ // explicit instantiation declaration<br>
+ extern template void TestFunctionTemplate(C);<br>
+<br>
+ // explicit instantiation definition<br>
+ template void TestFunctionTemplate(D);<br>
+}<br>
+// CHECK: FunctionTemplateDecl{{.*}} TestFunctionTemplate<br>
+// CHECK-NEXT: TemplateTypeParmDecl<br>
+// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate 'void (T)'<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} 'T'<br>
+// CHECK-NEXT: CompoundStmt<br>
+// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A<br>
+// CHECK-NEXT: TemplateArgument<br>
+// CHECK-NEXT: ParmVarDecl<br>
+// CHECK-NEXT: CompoundStmt<br>
+// CHECK-NEXT: Function{{.*}} 'TestFunctionTemplate' {{.*}}B<br>
+// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}C<br>
+// CHECK-NEXT: TemplateArgument<br>
+// CHECK-NEXT: ParmVarDecl<br>
+// CHECK-NEXT: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}D<br>
+// CHECK-NEXT: TemplateArgument<br>
+// CHECK-NEXT: ParmVarDecl<br>
+// CHECK-NEXT: CompoundStmt<br>
+// CHECK: FunctionDecl{{.*}} TestFunctionTemplate {{.*}}B<br>
+// CHECK-NEXT: TemplateArgument<br>
+// CHECK-NEXT: ParmVarDecl<br>
+<br>
+namespace testClassTemplateDecl {<br>
+ class A { };<br>
+ class B { };<br>
+ class C { };<br>
+ class D { };<br>
+<br>
+ template<typename T> class TestClassTemplate {<br>
+ int i;<br>
+ };<br>
+<br>
+ // implicit instantiation<br>
+ TestClassTemplate<A> a;<br>
+<br>
+ // explicit specialization<br>
+ template<> class TestClassTemplate<B> {<br>
+ int j;<br>
+ };<br>
+<br>
+ // explicit instantiation declaration<br>
+ extern template class TestClassTemplate<C>;<br>
+<br>
+ // explicit instantiation definition<br>
+ template class TestClassTemplate<D>;<br>
+<br>
+ // partial explicit specialization<br>
+ template<typename T1, typename T2> class TestClassTemplatePartial {<br>
+ int i;<br>
+ };<br>
+ template<typename T1> class TestClassTemplatePartial<T1, A> {<br>
+ int j;<br>
+ };<br>
+}<br>
+// CHECK: ClassTemplateDecl{{.*}} TestClassTemplate<br>
+// CHECK-NEXT: TemplateTypeParmDecl<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: FieldDecl{{.*}} i<br>
+// CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: TemplateArgument{{.*}}A<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: FieldDecl{{.*}} i<br>
+// CHECK: ClassTemplateSpecialization{{.*}} 'TestClassTemplate'<br>
+// CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate'<br>
+// CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate'<br>
+<br>
+// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: TemplateArgument{{.*}}B<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: FieldDecl{{.*}} j<br>
+<br>
+// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: TemplateArgument{{.*}}C<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: FieldDecl{{.*}} i<br>
+<br>
+// CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: TemplateArgument{{.*}}D<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate<br>
+// CHECK-NEXT: FieldDecl{{.*}} i<br>
+<br>
+// CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class TestClassTemplatePartial<br>
+// CHECK-NEXT: TemplateArgument<br>
+// CHECK-NEXT: TemplateArgument{{.*}}A<br>
+// CHECK-NEXT: TemplateTypeParmDecl<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplatePartial<br>
+// CHECK-NEXT: FieldDecl{{.*}} j<br>
+<br>
+template <class T><br>
+class TestClassScopeFunctionSpecialization {<br>
+ template<class U> void foo(U a) { }<br>
+ template<> void foo<int>(int a) { }<br>
+};<br>
+// CHECK: ClassScopeFunctionSpecializationDecl<br>
+// CHECK-NEXT: CXXMethod{{.*}} 'foo' 'void (int)'<br>
+// CHECK-NEXT: TemplateArgument{{.*}} 'int'<br>
+<br>
+namespace TestTemplateTypeParmDecl {<br>
+ template<typename ... T, class U = int> void foo();<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestTemplateTypeParmDecl<br>
+// CHECK-NEXT: FunctionTemplateDecl<br>
+// CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename ... T<br>
+// CHECK-NEXT: TemplateTypeParmDecl{{.*}} class U 'int'<br>
+<br>
+namespace TestNonTypeTemplateParmDecl {<br>
+ template<int I = 1, int ... J> void foo();<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestNonTypeTemplateParmDecl<br>
+// CHECK-NEXT: FunctionTemplateDecl<br>
+// CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' I<br>
+// CHECK-NEXT: IntegerLiteral{{.*}} 'int' 1<br>
+// CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' ... J<br>
+<br>
+namespace TestTemplateTemplateParmDecl {<br>
+ template<typename T> class A;<br>
+ template <template <typename> class T = A, template <typename> class ... U> void foo();<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestTemplateTemplateParmDecl<br>
+// CHECK: FunctionTemplateDecl<br>
+// CHECK-NEXT: TemplateTemplateParmDecl{{.*}} T<br>
+// CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename<br>
+// CHECK-NEXT: TemplateArgument{{.*}} template A<br>
+// CHECK-NEXT: TemplateTemplateParmDecl{{.*}} ... U<br>
+// CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename<br>
+<br>
+namespace TestTemplateArgument {<br>
+ template<typename> class A { };<br>
+ template<template<typename> class ...> class B { };<br>
+ int foo();<br>
+<br>
+ template<typename> class testType { };<br>
+ template class testType<int>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testType<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} type 'int'<br>
+<br>
+ template<int fp(void)> class testDecl { };<br>
+ template class testDecl<foo>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} decl<br>
+ // CHECK-NEXT: Function{{.*}}foo<br>
+<br>
+ template class testDecl<nullptr>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} nullptr<br>
+<br>
+ template<int> class testIntegral { };<br>
+ template class testIntegral<1>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testIntegral<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} integral 1<br>
+<br>
+ template<template<typename> class> class testTemplate { };<br>
+ template class testTemplate<A>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testTemplate<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} A<br>
+<br>
+ template<template<typename> class ...T> class C {<br>
+ B<T...> testTemplateExpansion;<br>
+ };<br>
+ // FIXME: Need TemplateSpecializationType dumping to test TemplateExpansion.<br>
+<br>
+ template<int, int = 0> class testExpr;<br>
+ template<int I> class testExpr<I> { };<br>
+ // CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class testExpr<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} expr<br>
+ // CHECK-NEXT: DeclRefExpr{{.*}}I<br>
+<br>
+ template<int, int ...> class testPack { };<br>
+ template class testPack<0, 1, 2>;<br>
+ // CHECK: ClassTemplateSpecializationDecl{{.*}} class testPack<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} integral 0<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} pack<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} integral 1<br>
+ // CHECK-NEXT: TemplateArgument{{.*}} integral 2<br>
+}<br>
+<br>
+namespace testUsingDecl {<br>
+ int i;<br>
+}<br>
+namespace TestUsingDecl {<br>
+ using testUsingDecl::i;<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestUsingDecl<br>
+// CHECK-NEXT: UsingDecl{{.*}} testUsingDecl::i<br>
+// CHECK-NEXT: UsingShadowDecl{{.*}} Var{{.*}} 'i' 'int'<br>
+<br>
+namespace testUnresolvedUsing {<br>
+ class A { };<br>
+ template<class T> class B {<br>
+ public:<br>
+ A a;<br>
+ };<br>
+ template<class T> class TestUnresolvedUsing : public B<T> {<br>
+ using typename B<T>::a;<br>
+ using B<T>::a;<br>
+ };<br>
+}<br>
+// CHECK: CXXRecordDecl{{.*}} TestUnresolvedUsing<br>
+// CHECK: UnresolvedUsingTypenameDecl{{.*}} B<T>::a<br>
+// CHECK: UnresolvedUsingValueDecl{{.*}} B<T>::a<br>
+<br>
+namespace TestLinkageSpecDecl {<br>
+ extern "C" void test1();<br>
+ extern "C++" void test2();<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestLinkageSpecDecl<br>
+// CHECK-NEXT: LinkageSpecDecl{{.*}} C<br>
+// CHECK-NEXT: FunctionDecl<br>
+// CHECK-NEXT: LinkageSpecDecl{{.*}} C++<br>
+// CHECK-NEXT: FunctionDecl<br>
+<br>
+class TestAccessSpecDecl {<br>
+public:<br>
+private:<br>
+protected:<br>
+};<br>
+// CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl<br>
+// CHECK-NEXT: CXXRecordDecl{{.*}} class TestAccessSpecDecl<br>
+// CHECK-NEXT: AccessSpecDecl{{.*}} public<br>
+// CHECK-NEXT: AccessSpecDecl{{.*}} private<br>
+// CHECK-NEXT: AccessSpecDecl{{.*}} protected<br>
+<br>
+template<typename T> class TestFriendDecl {<br>
+ friend int foo();<br>
+ friend class A;<br>
+ friend T;<br>
+};<br>
+// CHECK: CXXRecord{{.*}} TestFriendDecl<br>
+// CHECK-NEXT: CXXRecord{{.*}} TestFriendDecl<br>
+// CHECK-NEXT: FriendDecl<br>
+// CHECK-NEXT: FunctionDecl{{.*}} foo<br>
+// CHECK-NEXT: FriendDecl{{.*}} 'class A':'class A'<br>
+// CHECK-NEXT: FriendDecl{{.*}} 'T'<br>
+<br>
+namespace TestFileScopeAsmDecl {<br>
+ asm("ret");<br>
+}<br>
+// CHECK: NamespaceDecl{{.*}} TestFileScopeAsmDecl{{$}}<br>
+// CHECK: FileScopeAsmDecl{{.*>$}}<br>
+// CHECK-NEXT: StringLiteral<br>
<br>
Added: cfe/trunk/test/Misc/ast-dump-decl.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.m?rev=170634&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.m?rev=170634&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-decl.m (added)<br>
+++ cfe/trunk/test/Misc/ast-dump-decl.m Wed Dec 19 20:09:13 2012<br>
@@ -0,0 +1,136 @@<br>
+// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s<br>
+<br>
+@protocol P<br>
+@end<br>
+<br>
+@interface A<br>
+@end<br>
+<br>
+@interface TestObjCIvarDecl : A<br>
+@end<br>
+<br>
+@implementation TestObjCIvarDecl {<br>
+ int varDefault;<br>
+ @private int varPrivate;<br>
+ @protected int varProtected;<br>
+ @public int varPublic;<br>
+ @package int varPackage;<br>
+}<br>
+@end<br>
+// CHECK: ObjCImplementationDecl{{.*}} TestObjCIvarDecl<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCIvarDecl'<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} varDefault 'int' private<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} varPrivate 'int' private<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} varProtected 'int' protected<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} varPublic 'int' public<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} varPackage 'int' package<br>
+<br>
+@interface testObjCMethodDecl : A {<br>
+}<br>
+- (int) TestObjCMethodDecl: (int)i, ...;<br>
+// CHECK: ObjCMethodDecl{{.*}} - TestObjCMethodDecl: 'int'<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} i 'int'<br>
+// CHECK-NEXT: ...<br>
+@end<br>
+<br>
+@implementation testObjCMethodDecl<br>
+- (int) TestObjCMethodDecl: (int)i, ... {<br>
+ return 0;<br>
+}<br>
+// CHECK: ObjCMethodDecl{{.*}} - TestObjCMethodDecl: 'int'<br>
+// CHECK-NEXT: ImplicitParamDecl{{.*}} self<br>
+// CHECK-NEXT: ImplicitParamDecl{{.*}} _cmd<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} i 'int'<br>
+// CHECK-NEXT: ...<br>
+// CHECK-NEXT: CompoundStmt<br>
+@end<br>
+<br>
+@protocol TestObjCProtocolDecl<br>
+- (void) foo;<br>
+@end<br>
+// CHECK: ObjCProtocolDecl{{.*}} TestObjCProtocolDecl<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} foo<br>
+<br>
+@interface TestObjCClass : A <P><br>
+- (void) foo;<br>
+@end<br>
+// CHECK: ObjCInterfaceDecl{{.*}} TestObjCClass<br>
+// CHECK-NEXT: super ObjCInterface{{.*}} 'A'<br>
+// CHECK-NEXT: ObjCImplementation{{.*}} 'TestObjCClass'<br>
+// CHECK-NEXT: ObjCProtocol{{.*}} 'P'<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} foo<br>
+<br>
+@implementation TestObjCClass : A {<br>
+ int i;<br>
+}<br>
+- (void) foo {<br>
+}<br>
+@end<br>
+// CHECK: ObjCImplementationDecl{{.*}} TestObjCClass<br>
+// CHECK-NEXT: super ObjCInterface{{.*}} 'A'<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} i<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} foo<br>
+<br>
+@interface TestObjCClass (TestObjCCategoryDecl) <P><br>
+- (void) bar;<br>
+@end<br>
+// CHECK: ObjCCategoryDecl{{.*}} TestObjCCategoryDecl<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'<br>
+// CHECK-NEXT: ObjCCategoryImpl{{.*}} 'TestObjCClass'<br>
+// CHECK-NEXT: ObjCProtocol{{.*}} 'P'<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} bar<br>
+<br>
+@implementation TestObjCClass (TestObjCCategoryDecl)<br>
+- (void) bar {<br>
+}<br>
+@end<br>
+// CHECK: ObjCCategoryImplDecl{{.*}} TestObjCClass<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCClass'<br>
+// CHECK-NEXT: ObjCCategory{{.*}} 'TestObjCCategoryDecl'<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} bar<br>
+<br>
+@compatibility_alias TestObjCCompatibleAliasDecl A;<br>
+// CHECK: ObjCCompatibleAliasDecl{{.*}} TestObjCCompatibleAliasDecl<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'A'<br>
+<br>
+@interface TestObjCProperty: A<br>
+@property(getter=getterFoo, setter=setterFoo:) int foo;<br>
+@property int bar;<br>
+@end<br>
+// CHECK: ObjCInterfaceDecl{{.*}} TestObjCProperty<br>
+// CHECK: ObjCPropertyDecl{{.*}} foo 'int' assign readwrite atomic unsafe_unretained<br>
+// CHECK-NEXT: getter ObjCMethod{{.*}} 'getterFoo'<br>
+// CHECK-NEXT: setter ObjCMethod{{.*}} 'setterFoo:'<br>
+// CHECK-NEXT: ObjCPropertyDecl{{.*}} bar 'int' assign readwrite atomic unsafe_unretained<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} getterFoo<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} setterFoo:<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} foo<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} bar<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} setBar:<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} bar<br>
+<br>
+@implementation TestObjCProperty {<br>
+ int i;<br>
+}<br>
+@synthesize foo=i;<br>
+@synthesize bar;<br>
+@end<br>
+// CHECK: ObjCImplementationDecl{{.*}} TestObjCProperty<br>
+// CHECK: ObjCPropertyImplDecl{{.*}} foo synthesize<br>
+// CHECK-NEXT: ObjCProperty{{.*}} 'foo'<br>
+// CHECK-NEXT: ObjCIvar{{.*}} 'i' 'int'<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} bar 'int' synthesize private<br>
+// CHECK-NEXT: ObjCPropertyImplDecl{{.*}} bar synthesize<br>
+// CHECK-NEXT: ObjCProperty{{.*}} 'bar'<br>
+// CHECK-NEXT: ObjCIvar{{.*}} 'bar' 'int'<br>
+<br>
+void TestBlockDecl(int x) {<br>
+ ^(int y, ...){ x; };<br>
+}<br>
+// CHECK: FunctionDecl{{.*}}TestBlockDecl<br>
+// CHECK: BlockDecl<br>
+// CHECK-NEXT: ParmVarDecl{{.*}} y 'int'<br>
+// CHECK-NEXT: ...<br>
+// CHECK-NEXT: capture ParmVar{{.*}} 'x' 'int'<br>
+// CHECK-NEXT: CompoundStmt<br>
<br>
Added: cfe/trunk/test/Misc/<a href="http://ast-dump-decl.mm" target="_blank">ast-dump-decl.mm</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.mm?rev=170634&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-decl.mm?rev=170634&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/<a href="http://ast-dump-decl.mm" target="_blank">ast-dump-decl.mm</a> (added)<br>
+++ cfe/trunk/test/Misc/<a href="http://ast-dump-decl.mm" target="_blank">ast-dump-decl.mm</a> Wed Dec 19 20:09:13 2012<br>
@@ -0,0 +1,23 @@<br>
+// RUN: %clang_cc1 -Wno-unused -fblocks -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s<br>
+<br>
+@interface A<br>
+@end<br>
+<br>
+@interface TestObjCImplementation : A<br>
+@end<br>
+<br>
+@implementation TestObjCImplementation : A {<br>
+ struct X {<br>
+ int i;<br>
+ } X;<br>
+}<br>
+- (void) foo {<br>
+}<br>
+@end<br>
+// CHECK: ObjCImplementationDecl{{.*}} TestObjCImplementation<br>
+// CHECK-NEXT: super ObjCInterface{{.*}} 'A'<br>
+// CHECK-NEXT: ObjCInterface{{.*}} 'TestObjCImplementation'<br>
+// CHECK-NEXT: CXXCtorInitializer{{.*}} 'X'<br>
+// CHECK-NEXT: CXXConstructExpr<br>
+// CHECK-NEXT: ObjCIvarDecl{{.*}} X<br>
+// CHECK-NEXT: ObjCMethodDecl{{.*}} foo<br>
<br>
Modified: cfe/trunk/test/Misc/ast-dump-stmt.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-stmt.c?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-stmt.c?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-stmt.c (original)<br>
+++ cfe/trunk/test/Misc/ast-dump-stmt.c Wed Dec 19 20:09:13 2012<br>
@@ -1,31 +1,31 @@<br>
// RUN: %clang_cc1 -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s<br>
<br>
int TestLocation = 0;<br>
-// CHECK: Dumping TestLocation<br>
-// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <{{.*}}:3:20> 'int' 0<br>
+// CHECK: VarDecl{{.*}}TestLocation<br>
+// CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:20> 'int' 0<br>
<br>
int TestIndent = 1 + (1);<br>
-// CHECK: Dumping TestIndent<br>
-// CHECK-NEXT: {{\(BinaryOperator[^()]*$}}<br>
-// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)$}}<br>
-// CHECK-NEXT: {{^ \(ParenExpr.*0[^()]*$}}<br>
-// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)\)\)$}}<br>
+// CHECK: VarDecl{{.*}}TestIndent<br>
+// CHECK-NEXT: {{^ \(BinaryOperator[^()]*$}}<br>
+// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)$}}<br>
+// CHECK-NEXT: {{^ \(ParenExpr.*0[^()]*$}}<br>
+// CHECK-NEXT: {{^ \(IntegerLiteral.*0[^()]*\)\)\)\)$}}<br>
<br>
void TestDeclStmt() {<br>
int x = 0;<br>
int y, z;<br>
}<br>
-// CHECK: Dumping TestDeclStmt<br>
+// CHECK: FunctionDecl{{.*}}TestDeclStmt<br>
// CHECK-NEXT: CompoundStmt<br>
// CHECK-NEXT: DeclStmt<br>
-// CHECK-NEXT: int x =<br>
+// CHECK-NEXT: VarDecl{{.*}}x<br>
// CHECK-NEXT: IntegerLiteral<br>
// CHECK-NEXT: DeclStmt<br>
-// CHECK-NEXT: int y<br>
-// CHECK-NEXT: int z<br>
+// CHECK-NEXT: VarDecl{{.*}}y<br>
+// CHECK-NEXT: VarDecl{{.*}}z<br>
<br>
int TestOpaqueValueExpr = 0 ?: 1;<br>
-// CHECK: Dumping TestOpaqueValueExpr<br>
+// CHECK: VarDecl{{.*}}TestOpaqueValueExpr<br>
// CHECK-NEXT: BinaryConditionalOperator<br>
// CHECK-NEXT: IntegerLiteral<br>
// CHECK-NEXT: OpaqueValueExpr<br>
<br>
Modified: cfe/trunk/test/Misc/ast-dump-stmt.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-stmt.m?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-stmt.m?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-stmt.m (original)<br>
+++ cfe/trunk/test/Misc/ast-dump-stmt.m Wed Dec 19 20:09:13 2012<br>
@@ -3,15 +3,14 @@<br>
void TestBlockExpr(int x) {<br>
^{ x; };<br>
}<br>
-// CHECK: Dumping TestBlockExpr<br>
-// CHECK: BlockExpr{{.*}} decl=<br>
-// CHECK-NEXT: capture ParmVar<br>
-// CHECK-NEXT: CompoundStmt<br>
+// CHECK: FunctionDecl{{.*}}TestBlockExpr<br>
+// CHECK: BlockExpr{{.*}} 'void (^)(void)'<br>
+// CHECK-NEXT: BlockDecl<br>
<br>
void TestExprWithCleanup(int x) {<br>
^{ x; };<br>
}<br>
-// CHECK: Dumping TestExprWithCleanup<br>
+// CHECK: FunctionDecl{{.*}}TestExprWithCleanup<br>
// CHECK: ExprWithCleanups<br>
// CHECK-NEXT: cleanup Block<br>
// CHECK-NEXT: BlockExpr<br>
@@ -26,10 +25,11 @@<br>
} @finally {<br>
}<br>
}<br>
-// CHECK: Dumping TestObjCAtCatchStmt<br>
+// CHECK: FunctionDecl{{.*}}TestObjCAtCatchStmt<br>
// CHECK: ObjCAtTryStmt<br>
// CHECK-NEXT: CompoundStmt<br>
-// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch parm = "A *a"<br>
+// CHECK-NEXT: ObjCAtCatchStmt{{.*}}<br>
+// CHECK-NEXT: VarDecl{{.*}}a<br>
// CHECK-NEXT: CompoundStmt<br>
// CHECK-NEXT: ObjCAtCatchStmt{{.*}} catch all<br>
// CHECK-NEXT: CompoundStmt<br>
<br>
Modified: cfe/trunk/test/Misc/ast-dump-templates.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-templates.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-templates.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-templates.cpp (original)<br>
+++ cfe/trunk/test/Misc/ast-dump-templates.cpp Wed Dec 19 20:09:13 2012<br>
@@ -1,4 +1,4 @@<br>
-// RUN: %clang_cc1 -ast-dump %s > %t<br>
+// RUN: %clang_cc1 -ast-print %s > %t<br>
// RUN: FileCheck < %t %s -check-prefix=CHECK1<br>
// RUN: FileCheck < %t %s -check-prefix=CHECK2<br>
<br>
@@ -27,8 +27,8 @@<br>
// CHECK2: template <int X = 2, typename Y = double, int Z = 3> struct foo {<br>
<br>
// Template definition - foo<br>
-// CHECK1: template <int X, typename Y, int Z = (IntegerLiteral {{.*}} 'int' 5)<br>
-// CHECK2: template <int X, typename Y, int Z = (IntegerLiteral {{.*}} 'int' 5)<br>
+// CHECK1: template <int X, typename Y, int Z = 5> struct foo {<br>
+// CHECK2: template <int X, typename Y, int Z = 5> struct foo {<br>
<br>
// Template instantiation - bar<br>
// CHECK1: template <int A = 5, typename B = int> int bar()<br>
<br>
Modified: cfe/trunk/test/Misc/ast-dump-wchar.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-wchar.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-wchar.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Misc/ast-dump-wchar.cpp (original)<br>
+++ cfe/trunk/test/Misc/ast-dump-wchar.cpp Wed Dec 19 20:09:13 2012<br>
@@ -1,13 +1,13 @@<br>
// RUN: %clang_cc1 -std=c++11 -ast-dump %s -triple x86_64-linux-gnu | FileCheck %s<br>
<br>
char c8[] = u8"test\0\\\"\t\a\b\234";<br>
-// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")<br>
+// CHECK: (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")<br>
<br>
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";<br>
-// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234")<br>
+// CHECK: (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234")<br>
<br>
char32_t c32[] = U"test\0\\\"\t\a\b\234\u1234\U0010ffff"; // \<br>
-// CHECK: char32_t c32[14] = (StringLiteral {{.*}} lvalue U"test\000\\\"\t\a\b\234\u1234\U0010FFFF")<br>
+// CHECK: (StringLiteral {{.*}} lvalue U"test\000\\\"\t\a\b\234\u1234\U0010FFFF")<br>
<br>
wchar_t wc[] = L"test\0\\\"\t\a\b\234\u1234\xffffffff"; // \<br>
-// CHECK: wchar_t wc[14] = (StringLiteral {{.*}} lvalue L"test\000\\\"\t\a\b\234\x1234\xFFFFFFFF")<br>
+// CHECK: (StringLiteral {{.*}} lvalue L"test\000\\\"\t\a\b\234\x1234\xFFFFFFFF")<br>
<br>
Modified: cfe/trunk/test/PCH/objc_stmts.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objc_stmts.m?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/objc_stmts.m?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/PCH/objc_stmts.m (original)<br>
+++ cfe/trunk/test/PCH/objc_stmts.m Wed Dec 19 20:09:13 2012<br>
@@ -1,12 +1,12 @@<br>
// Test this without pch.<br>
// RUN: %clang_cc1 -include %S/objc_stmts.h -emit-llvm -fobjc-exceptions -o - %s<br>
-// RUN: %clang_cc1 -include %S/objc_stmts.h -ast-dump -fobjc-exceptions -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -include %S/objc_stmts.h -ast-print -fobjc-exceptions -o - %s | FileCheck %s<br>
<br>
// Test with pch.<br>
// RUN: %clang_cc1 -x objective-c -emit-pch -fobjc-exceptions -o %t %S/objc_stmts.h<br>
// RUN: %clang_cc1 -include-pch %t -emit-llvm -fobjc-exceptions -o - %s<br>
-// RUN: %clang_cc1 -include-pch %t -ast-dump -fobjc-exceptions -o - %s | FileCheck %s<br>
+// RUN: %clang_cc1 -include-pch %t -ast-print -fobjc-exceptions -o - %s | FileCheck %s<br>
<br>
-// CHECK: catch parm = "A *a"<br>
-// CHECK: catch parm = "B *b"<br>
-// CHECK: catch all<br>
+// CHECK: @catch(A *a)<br>
+// CHECK: @catch(B *b)<br>
+// CHECK: @catch()<br>
<br>
Modified: cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp (original)<br>
+++ cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp Wed Dec 19 20:09:13 2012<br>
@@ -10,9 +10,9 @@<br>
bar(int x = kSomeConst) {}<br>
};<br>
<br>
- // CHECK: void f()<br>
+ // CHECK: FunctionDecl{{.*}}f 'void (void)'<br>
void f() {<br>
- // CHECK: bar<int> tmp =<br>
+ // CHECK: VarDecl{{.*}}tmp 'bar<int>'<br>
// CHECK: CXXDefaultArgExpr{{.*}}'int'<br>
bar<int> tmp;<br>
}<br>
<br>
Modified: cfe/trunk/test/Tooling/clang-check-ast-dump.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Tooling/clang-check-ast-dump.cpp?rev=170634&r1=170633&r2=170634&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Tooling/clang-check-ast-dump.cpp?rev=170634&r1=170633&r2=170634&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Tooling/clang-check-ast-dump.cpp (original)<br>
+++ cfe/trunk/test/Tooling/clang-check-ast-dump.cpp Wed Dec 19 20:09:13 2012<br>
@@ -1,15 +1,19 @@<br>
// RUN: clang-check -ast-dump "%s" -- 2>&1 | FileCheck %s<br>
-// CHECK: namespace test_namespace<br>
-// CHECK-NEXT: class TheClass<br>
-// CHECK: int theMethod(int x) (CompoundStmt<br>
+// CHECK: (NamespaceDecl{{.*}}test_namespace<br>
+// CHECK-NEXT: (CXXRecordDecl{{.*}}TheClass<br>
+// CHECK: (CXXMethodDecl{{.*}}theMethod<br>
+// CHECK-NEXT: (ParmVarDecl{{.*}}x<br>
+// CHECK-NEXT: (CompoundStmt<br>
// CHECK-NEXT: (ReturnStmt<br>
// CHECK-NEXT: (BinaryOperator<br>
//<br>
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::theMethod "%s" -- 2>&1 | FileCheck -check-prefix CHECK-FILTER %s<br>
-// CHECK-FILTER-NOT: namespace test_namespace<br>
-// CHECK-FILTER-NOT: class TheClass<br>
+// CHECK-FILTER-NOT: NamespaceDecl<br>
+// CHECK-FILTER-NOT: CXXRecordDecl<br>
// CHECK-FILTER: {{^}}Dumping test_namespace::TheClass::theMethod<br>
-// CHECK-FILTER-NEXT: {{^}}int theMethod(int x) (CompoundStmt<br>
+// CHECK-FILTER-NEXT: {{^}}(CXXMethodDecl{{.*}}theMethod<br>
+// CHECK-FILTER-NEXT: (ParmVarDecl{{.*}}x<br>
+// CHECK-FILTER-NEXT: (CompoundStmt<br>
// CHECK-FILTER-NEXT: (ReturnStmt<br>
// CHECK-FILTER-NEXT: (BinaryOperator<br>
//<br>
@@ -26,7 +30,8 @@<br>
//<br>
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s<br>
// CHECK-ATTR: test_namespace<br>
-// CHECK-ATTR-NEXT: int n __attribute__((aligned((BinaryOperator<br>
+// CHECK-ATTR-NEXT: (FieldDecl{{.*}}n<br>
+// FIXME: attribute dumping not implemented yet<br>
//<br>
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::AfterNullNode "%s" -- 2>&1 | FileCheck -check-prefix CHECK-AFTER-NULL %s<br>
// CHECK-AFTER-NULL: class AfterNullNode<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>