summaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2013-09-11 00:38:02 +0000
committerNico Rieck <nico.rieck@gmail.com>2013-09-11 00:38:02 +0000
commit2956ef43da9c0e7bce8fae4a015255a2c19458bb (patch)
tree7d4ff720dd94819a0e46863260398c8cb07fedb8 /lib/Driver/Tools.cpp
parent2d2aed29220dcad17c36479901281376e36637eb (diff)
downloadclang-2956ef43da9c0e7bce8fae4a015255a2c19458bb.tar.gz
clang-2956ef43da9c0e7bce8fae4a015255a2c19458bb.tar.bz2
clang-2956ef43da9c0e7bce8fae4a015255a2c19458bb.tar.xz
Add -fansi-escape-codes option
Some build systems use pipes for stdin/stderr. On nix-ish platforms colored output can be forced by -fcolor-diagnostics. On Windows this option has no effect in these cases because LLVM uses the console API (which only operates on the console buffer) even if a console wrapper capable of interpreting ANSI escape codes is used. The -fansi-escape-codes option allows switching from the console API to ANSI escape codes. It has no effect on other platforms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 79cdb042a9..d72358dca0 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3370,6 +3370,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(ShowColors == Colors_Auto && llvm::sys::Process::StandardErrHasColors()))
CmdArgs.push_back("-fcolor-diagnostics");
+ if (Args.hasArg(options::OPT_fansi_escape_codes))
+ CmdArgs.push_back("-fansi-escape-codes");
+
if (!Args.hasFlag(options::OPT_fshow_source_location,
options::OPT_fno_show_source_location))
CmdArgs.push_back("-fno-show-source-location");