[cfe-commits] r113296 - /cfe/trunk/lib/AST/DeclPrinter.cpp
Ted Kremenek
kremenek at apple.com
Tue Sep 7 15:21:59 PDT 2010
Author: kremenek
Date: Tue Sep 7 17:21:59 2010
New Revision: 113296
URL: http://llvm.org/viewvc/llvm-project?rev=113296&view=rev
Log:
Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl. Patch by Jim Goodnow II!
Modified:
cfe/trunk/lib/AST/DeclPrinter.cpp
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=113296&r1=113295&r2=113296&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Tue Sep 7 17:21:59 2010
@@ -518,12 +518,12 @@
T = Parm->getOriginalType();
T.getAsStringInternal(Name, Policy);
Out << Name;
- if (D->getInit()) {
+ if (Expr *Init = D->getInit()) {
if (D->hasCXXDirectInitializer())
Out << "(";
- else
+ else if (!dyn_cast<CXXConstructExpr>(Init))
Out << " = ";
- D->getInit()->printPretty(Out, Context, 0, Policy, Indentation);
+ Init->printPretty(Out, Context, 0, Policy, Indentation);
if (D->hasCXXDirectInitializer())
Out << ")";
}
More information about the cfe-commits
mailing list