[PATCH] D65854: [diagtool] Use `operator<<(Colors)` to print out colored output.

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 7 03:03:56 PDT 2019


MaskRay added inline comments.


================
Comment at: clang/tools/diagtool/TreeView.cpp:167
+  if (!hasColors(out))
+    out.enable_colors(false);
+
----------------
`out.enable_colors(out.has_colors());`

It looks the function `hasColors` is overengineered. `out` in these files can only be `llvm::outs()`. It doesn't have to check if `llvm::errs()` is connected to a terminal.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65854/new/

https://reviews.llvm.org/D65854





More information about the cfe-commits mailing list