llvm-capstone/lld/lib
Rui Ueyama a52f982f1c Improve raw_ostream so that you can "write" colors using operator<<
1. raw_ostream supports ANSI colors so that you can write messages to
the termina with colors. Previously, in order to change and reset
color, you had to call `changeColor` and `resetColor` functions,
respectively.

So, if you print out "error: " in red, for example, you had to do
something like this:

  OS.changeColor(raw_ostream::RED);
  OS << "error: ";
  OS.resetColor();

With this patch, you can write the same code as follows:

  OS << raw_ostream::RED << "error: " << raw_ostream::RESET;

2. Add a boolean flag to raw_ostream so that you can disable colored
output. If you disable colors, changeColor, operator<<(Color),
resetColor and other color-related functions have no effect.

Most LLVM tools automatically prints out messages using colors, and
you can disable it by passing a flag such as `--disable-colors`.
This new flag makes it easy to write code that works that way.

Differential Revision: https://reviews.llvm.org/D65564

llvm-svn: 367649
2019-08-02 04:48:30 +00:00
..
Core Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver Improve raw_ostream so that you can "write" colors using operator<< 2019-08-02 04:48:30 +00:00
ReaderWriter Use llvm::stable_sort 2019-04-23 02:42:06 +00:00
CMakeLists.txt Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00