[cfe-commits] [PATCH] Clean up StmtDumper indentation

Philip Craig philipjcraig at gmail.com
Thu Nov 1 15:29:13 PDT 2012

Comment at: lib/AST/StmtDumper.cpp:33
@@ -32,2 +32,3 @@
     unsigned IndentLevel;
+    bool NeedNewLine;
Manuel Klimek wrote:
> I think it's not immediately clear what cases are handled by this bool - a comment would help me here...
> After reading the whole patch, it looks like this is mainly there for the first newline... If that's true, I'd probably call it IsFirstLine or something.
That's the main reason. I'm also allowing for multiple flush calls.

Comment at: lib/AST/StmtDumper.cpp:92
@@ +91,3 @@
+    void flush() {
+      if (NeedNewLine)
+        OS << "\n";
Manuel Klimek wrote:
> Can that ever be false in flush()
I'm probably over generalizing here. I can delete the flush method and just always print the newline in the destructor. After doing that, NeedNewLine can be renamed to IsFirstLine.


More information about the cfe-commits mailing list