[PATCH] D65564: Improve raw_ostream so that you can "write" colors using operator<<
Rui Ueyama via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 1 20:11:20 PDT 2019
ruiu marked an inline comment as done.
ruiu added inline comments.
================
Comment at: clang/tools/diagtool/TreeView.cpp:30
- TreePrinter(llvm::raw_ostream &out)
- : out(out), ShowColors(hasColors(out)), Internal(false) {}
-
- void setColor(llvm::raw_ostream::Colors Color) {
- if (ShowColors)
- out << llvm::sys::Process::OutputColor(Color, false, false);
- }
-
- void resetColor() {
- if (ShowColors)
- out << llvm::sys::Process::ResetColor();
+ TreePrinter(llvm::raw_ostream &out) : out(out), Internal(false) {
+ if (&out != &llvm::errs() && &out != &llvm::outs())
----------------
grimar wrote:
> nit: Seems `out` should be uppercase here.
> (I see it was like that before your changes, but seems you touching all the places where it was used, so seems you can fix it).
Yes, this is inconsistent, but we probably shouldn't change this in this patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65564/new/
https://reviews.llvm.org/D65564
More information about the cfe-commits
mailing list