[cfe-commits] [PATCH] Addition of color to -ast-dump

Richard Smith richard at metafoo.co.uk
Wed Jan 23 19:31:02 PST 2013


  LGTM; the remaining comment here regarding factoring out some TerminalColors constants is fine to look into post-commit.


================
Comment at: lib/AST/ASTDumper.cpp:113
@@ -58,1 +112,3 @@
+        LastLocFilename(""), LastLocLine(~0U),
+        ShowColors(SM && SM->getDiagnostics().getShowColors()) { }
 
----------------
Philip Craig wrote:
> I used OS.has_colors() in lib/Frontend/ASTConsumers.cpp. We probably should be consistent between these. I don't know which is better.
Using getShowColors() seems a better choice (both here and in ASTConsumers), since it allows the behavior to be controlled independently of whether we're writing to a terminal.


http://llvm-reviews.chandlerc.com/D291



More information about the cfe-commits mailing list