diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-04 06:24:57 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-04 06:24:57 +0000 |
commit | 838be483dcf10ea3f2acd85f2cd65adc310011f9 (patch) | |
tree | e1f8025c155bfed0acf97c981636d1b0681977a2 /lib/Driver/Tools.cpp | |
parent | 55efe142a84b2aab6d0186c20a311c347a65f794 (diff) |
Move -fcolor-diagnostics logic to driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 04463be37f..808c31c648 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -955,9 +955,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasFlag(options::OPT_fdiagnostics_show_option, options::OPT_fno_diagnostics_show_option)) CmdArgs.push_back("-fdiagnostics-show-option"); - if (!Args.hasFlag(options::OPT_fcolor_diagnostics, - options::OPT_fno_color_diagnostics)) - CmdArgs.push_back("-fno-color-diagnostics"); + + // Color diagnostics are the default, unless the terminal doesn't support + // them. + if (Args.hasFlag(options::OPT_fcolor_diagnostics, + options::OPT_fno_color_diagnostics) && + llvm::sys::Process::StandardErrHasColors()) + CmdArgs.push_back("-fcolor-diagnostics"); + if (!Args.hasFlag(options::OPT_fshow_source_location, options::OPT_fno_show_source_location)) CmdArgs.push_back("-fno-show-source-location"); |