forked from OSchip/llvm-project
Use raw_fd_ostream::has_colors instead of StandardErrHasColors().
I just didn't know that raw_fd_ostream has has_colors() function. llvm-svn: 298749
This commit is contained in:
parent
561d72c328
commit
22f0d804f5
|
@ -53,12 +53,10 @@ ELFOptTable::ELFOptTable() : OptTable(OptInfo) {}
|
|||
|
||||
// Parse -color-diagnostics={auto,always,never} or -no-color-diagnostics.
|
||||
static bool getColorDiagnostics(opt::InputArgList &Args) {
|
||||
bool Default = (ErrorOS == &errs() && Process::StandardErrHasColors());
|
||||
|
||||
auto *Arg = Args.getLastArg(OPT_color_diagnostics, OPT_color_diagnostics_eq,
|
||||
OPT_no_color_diagnostics);
|
||||
if (!Arg)
|
||||
return Default;
|
||||
return ErrorOS->has_colors();
|
||||
if (Arg->getOption().getID() == OPT_color_diagnostics)
|
||||
return true;
|
||||
if (Arg->getOption().getID() == OPT_no_color_diagnostics)
|
||||
|
@ -66,7 +64,7 @@ static bool getColorDiagnostics(opt::InputArgList &Args) {
|
|||
|
||||
StringRef S = Arg->getValue();
|
||||
if (S == "auto")
|
||||
return Default;
|
||||
return ErrorOS->has_colors();
|
||||
if (S == "always")
|
||||
return true;
|
||||
if (S != "never")
|
||||
|
|
Loading…
Reference in New Issue