diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-11-26 15:10:01 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-11-26 15:10:01 +0000 |
| commit | 72b1ee2533f6e7f574fd183f91cb2fc72463a415 (patch) | |
| tree | 8a9da2a187fd201c3650257d5b94c425ba8fcd77 /lld/ELF/Error.cpp | |
| parent | 1880bbed392528c1a3e14e24a298b69d6936a4a8 (diff) | |
| download | bcm5719-llvm-72b1ee2533f6e7f574fd183f91cb2fc72463a415.tar.gz bcm5719-llvm-72b1ee2533f6e7f574fd183f91cb2fc72463a415.zip | |
Make getColorDiagnostics return a boolean value instead of an enum.
Config->ColorDiagnostics was of type enum before. Now it is just a
boolean flag. Thanks Rafael for suggestion.
llvm-svn: 287978
Diffstat (limited to 'lld/ELF/Error.cpp')
| -rw-r--r-- | lld/ELF/Error.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lld/ELF/Error.cpp b/lld/ELF/Error.cpp index 1a66048983e..6e30f08143e 100644 --- a/lld/ELF/Error.cpp +++ b/lld/ELF/Error.cpp @@ -13,7 +13,6 @@ #include "llvm/ADT/Twine.h" #include "llvm/Support/Error.h" #include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/Process.h" #include "llvm/Support/raw_ostream.h" #include <mutex> @@ -34,17 +33,9 @@ StringRef elf::Argv0; // but outs() or errs() are not thread-safe. We protect them using a mutex. static std::mutex Mu; -static bool useColor() { - if (Config->ColorDiagnostics == ColorPolicy::Always) - return true; - if (Config->ColorDiagnostics == ColorPolicy::Never) - return false; - return ErrorOS == &errs() && sys::Process::StandardErrHasColors(); -} - static void print(StringRef S, raw_ostream::Colors C) { *ErrorOS << Argv0 + ": "; - if (useColor()) { + if (Config->ColorDiagnostics) { ErrorOS->changeColor(C, true); *ErrorOS << S; ErrorOS->resetColor(); |

