diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-12-06 18:50:39 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-12-06 18:50:39 +0000 |
commit | 4c9fa4a0a137c250ecb977ebed5577cc131e94e6 (patch) | |
tree | 0c777577be3c0b2ac63d408926bec931426572d9 /clang/lib/Driver/ToolChains/Clang.cpp | |
parent | 56ff1fd5b1a188d6792614fd87d1825f181e2266 (diff) | |
download | bcm5719-llvm-4c9fa4a0a137c250ecb977ebed5577cc131e94e6.tar.gz bcm5719-llvm-4c9fa4a0a137c250ecb977ebed5577cc131e94e6.zip |
Allow forwarding -fdebug-compilation-dir to cc1as
The flag -fdebug-compilation-dir is useful to make generated .o files
independent of the path of the build directory, without making the compile
command-line dependent on the path of the build directory, like
-fdebug-prefix-map requires. This change makes it so that the driver can
forward the flag to -cc1as, like it already can for -cc1. We might want to
consider making -fdebug-compilation-dir a driver flag in a follow-up.
(Since -fdebug-compilation-dir defaults to PWD, it's already possible to get
this effect by setting PWD, but explicit compiler flags are better than env
vars, because e.g. ninja tracks command lines and reruns commands that change.)
Somewhat related to PR14625.
Differential Revision: https://reviews.llvm.org/D55377
llvm-svn: 348515
Diffstat (limited to 'clang/lib/Driver/ToolChains/Clang.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Clang.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 3ebf4408005..bd04317966f 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2152,6 +2152,9 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, } CmdArgs.push_back(Value.data()); TakeNextArg = true; + } else if (Value == "-fdebug-compilation-dir") { + CmdArgs.push_back("-fdebug-compilation-dir"); + TakeNextArg = true; } else { D.Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; |