[cfe-commits] [PATCH][Review Request] - AST Print Problem with Constructor Initializer(version2)

Jim Goodnow II jim at thegoodnows.net
Fri Sep 3 11:34:13 PDT 2010


Didn't quite get it right the first time, but there is still a 
problem with arguments not being printed. Will look into it.

  - jim

Index: lib/AST/DeclPrinter.cpp
===================================================================
--- lib/AST/DeclPrinter.cpp	(revision 112954)
+++ lib/AST/DeclPrinter.cpp	(working copy)
@@ -518,12 +518,13 @@
      T = Parm->getOriginalType();
    T.getAsStringInternal(Name, Policy);
    Out << Name;
-  if (D->getInit()) {
+  Expr *Init = D->getInit();
+  if (Init) {
      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 << ")";
    }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DeclPrinter.patch
Type: application/octet-stream
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100903/4a4ded56/attachment.obj>


More information about the cfe-commits mailing list