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

Matthieu Monrocq matthieu.monrocq at gmail.com
Wed Jan 23 09:24:30 PST 2013


On Wed, Jan 23, 2013 at 12:12 PM, Philip Craig <philipjcraig at gmail.com>wrote:

>
>
> ================
> Comment at: include/clang/AST/DeclBase.h:853
> @@ -852,2 +852,3 @@
>    // Debuggers don't usually respect default arguments.
>    LLVM_ATTRIBUTE_USED void dump() const;
> +  // Same as dump(), but forces color printing.
> ----------------
> Saleem Abdulrasool wrote:
> > Why not make colour a default valued parameter for dump?  This would
> avoid duplication of the method as well as reduce the interface.
> As the comment states, debuggers don't handle default arguments.
>
> ================
> Comment at: lib/AST/ASTDumper.cpp:113
> @@ -58,1 +112,3 @@
> +        LastLocFilename(""), LastLocLine(~0U),
> +        ShowColors(SM && SM->getDiagnostics().getShowColors()) { }
>
> ----------------
> I used OS.has_colors() in lib/Frontend/ASTConsumers.cpp. We probably
> should be consistent between these. I don't know which is better.
>
>
> http://llvm-reviews.chandlerc.com/D291
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>

Is OS.has_colors() correctly set in case of pipes ? If not then it makes
sense to use a user available flag.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130123/053caceb/attachment.html>


More information about the cfe-commits mailing list