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

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 00:41:52 PDT 2018


jdenny created this revision.
jdenny added reviewers: bkramer, JDevlieghere, probinson, hfinkel.
Herald added subscribers: kristina, hiraditya.

While this change specifically targets FileCheck, it affects any tool
using the same SourceMgr facilities.

Previously, -color was documented in FileCheck's -help output, but 
-color had no effect.  Now, -color obeys its documentation: it forces
colors to be used in FileCheck diagnostics even when stderr is not a
terminal.

-color is especially helpful when combined with FileCheck's -v, which
can produce a long series of diagnostics that you might wish to pipe
to a pager, such as less -R.  The WithColor extensions here will also
help to clean up color usage in FileCheck's annotated dump of input,
which is proposed in https://reviews.llvm.org/D52999.


Repository:
  rL LLVM

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53419.170151.patch
Type: text/x-patch
Size: 14285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181019/75e9317c/attachment.bin>


More information about the llvm-commits mailing list