[PATCH] D53419: [SourceMgr][FileCheck] Obey -color by extending WithColor

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 14:12:32 PDT 2018


jdenny updated this revision to Diff 170749.
jdenny added reviewers: teemperor, xbolva00, nrieck.
jdenny added a comment.

The patch was reverted because the test it introduces fails on some Windows bots where color isn't supported as expected.

I've added a small change: at the start of FileCheck's main, call llvm::sys::Process::UseANSIEscapeCodes(true) unconditionally.  This is a no-op for Linux, but it fixes the test for my Windows 10 install, and it seems to make FileCheck colors behave ok in my brief cmd.exe experiments.

However, I'm not a Windows developer.  I see that each of clang and lldb handles Windows colors in its own unique and more complex way, which I haven't fully grasped.

I've added some reviewers who, according to git blame, have worked with Windows colors for LLVM before.  Before I commit again, could someone please comment as to whether this change looks ok for FileCheck under Windows?

Thanks.


https://reviews.llvm.org/D53419

Files:
  llvm/docs/CommandGuide/FileCheck.rst
  llvm/include/llvm/Support/WithColor.h
  llvm/lib/Support/SourceMgr.cpp
  llvm/lib/Support/WithColor.cpp
  llvm/test/FileCheck/opt-color.txt
  llvm/utils/FileCheck/FileCheck.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53419.170749.patch
Type: text/x-patch
Size: 14983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/c1dc8ee7/attachment.bin>


More information about the llvm-commits mailing list