<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style>On Thu, Dec 20, 2012 at 3:08 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank" class="cremed">alexfh@google.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: alexfh<br>
Date: Thu Dec 20 05:08:38 2012<br>
New Revision: 170684<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=170684&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=170684&view=rev</a><br>
Log:<br>
ASTDumper coding style fixes.<br>
<a href="http://llvm-reviews.chandlerc.com/D226" target="_blank" class="cremed">http://llvm-reviews.chandlerc.com/D226</a><br>
<br>
Patch by Philip Craig!<br>
<br>
<br>
Modified:<br>
cfe/trunk/lib/AST/ASTDumper.cpp<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=170684&r1=170683&r2=170684&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=170684&r1=170683&r2=170684&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTDumper.cpp Thu Dec 20 05:08:38 2012<br>
@@ -70,15 +70,15 @@<br>
void dumpLocation(SourceLocation Loc);<br>
void dumpBareType(QualType T);<br>
void dumpType(QualType T);<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>
+ void dumpBareDeclRef(const Decl *Node);<br>
+ void dumpDeclRef(const Decl *Node, const char *Label = NULL);<br></blockquote><div><br></div><div style>Speaking of coding style, LLVM's style is to use '0' not 'NULL'.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ void dumpName(const NamedDecl *D);<br>
+ void dumpDeclContext(const DeclContext *DC);<br>
<br>
// C++ Utilities<br>
void dumpAccessSpecifier(AccessSpecifier AS);<br>
- void dumpCXXCtorInitializer(CXXCtorInitializer *Init);<br>
- void dumpTemplateParameters(TemplateParameterList *TPL);<br>
+ void dumpCXXCtorInitializer(const CXXCtorInitializer *Init);<br>
+ void dumpTemplateParameters(const TemplateParameterList *TPL);<br>
void dumpTemplateArgumentListInfo(const TemplateArgumentListInfo &TALI);<br>
void dumpTemplateArgumentLoc(const TemplateArgumentLoc &A);<br>
void dumpTemplateArgumentList(const TemplateArgumentList &TAL);<br>
@@ -271,21 +271,21 @@<br>
dumpBareType(T);<br>
}<br>
<br>
-void ASTDumper::dumpBareDeclRef(Decl *D) {<br>
+void ASTDumper::dumpBareDeclRef(const Decl *D) {<br>
OS << D->getDeclKindName();<br>
dumpPointer(D);<br>
<br>
- if (NamedDecl *ND = dyn_cast<NamedDecl>(D)) {<br>
+ if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {<br>
OS << " '";<br>
ND->getDeclName().printName(OS);<br>
OS << "'";<br>
}<br>
<br>
- if (ValueDecl *VD = dyn_cast<ValueDecl>(D))<br>
+ if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))<br>
dumpType(VD->getType());<br>
}<br>
<br>
-void ASTDumper::dumpDeclRef(Decl *D, const char *Label) {<br>
+void ASTDumper::dumpDeclRef(const Decl *D, const char *Label) {<br>
if (!D)<br>
return;<br>
<br>
@@ -295,12 +295,12 @@<br>
dumpBareDeclRef(D);<br>
}<br>
<br>
-void ASTDumper::dumpName(NamedDecl *ND) {<br>
+void ASTDumper::dumpName(const NamedDecl *ND) {<br>
if (ND->getDeclName())<br>
OS << ' ' << ND->getNameAsString();<br>
}<br>
<br>
-void ASTDumper::dumpDeclContext(DeclContext *DC) {<br>
+void ASTDumper::dumpDeclContext(const DeclContext *DC) {<br>
if (!DC)<br>
return;<br>
for (DeclContext::decl_iterator I = DC->decls_begin(), E = DC->decls_end();<br>
@@ -328,7 +328,7 @@<br>
}<br>
}<br>
<br>
-void ASTDumper::dumpCXXCtorInitializer(CXXCtorInitializer *Init) {<br>
+void ASTDumper::dumpCXXCtorInitializer(const CXXCtorInitializer *Init) {<br>
IndentScope Indent(*this);<br>
OS << "CXXCtorInitializer";<br>
if (Init->isAnyMemberInitializer()) {<br>
@@ -340,11 +340,11 @@<br>
dumpStmt(Init->getInit());<br>
}<br>
<br>
-void ASTDumper::dumpTemplateParameters(TemplateParameterList *TPL) {<br>
+void ASTDumper::dumpTemplateParameters(const TemplateParameterList *TPL) {<br>
if (!TPL)<br>
return;<br>
<br>
- for (TemplateParameterList::iterator I = TPL->begin(), E = TPL->end();<br>
+ for (TemplateParameterList::const_iterator I = TPL->begin(), E = TPL->end();<br>
I != E; ++I)<br>
dumpDecl(*I);<br>
}<br>
@@ -386,8 +386,7 @@<br>
OS << " nullptr";<br>
break;<br>
case TemplateArgument::Integral:<br>
- OS << " integral";<br>
- OS << ' ' << A.getAsIntegral();<br>
+ OS << " integral " << A.getAsIntegral();<br>
break;<br>
case TemplateArgument::Template:<br>
OS << " template ";<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" class="cremed">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div></div>