aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 77456faa1e..afcf26fee1 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1325,8 +1325,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_dM);
Args.AddLastArg(CmdArgs, options::OPT_dD);
+ // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
+ // parser.
Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
- Args.AddAllArgValues(CmdArgs, options::OPT_mllvm);
+ for (arg_iterator it = Args.filtered_begin(options::OPT_mllvm),
+ ie = Args.filtered_end(); it != ie; ++it) {
+ // We translate this by hand to the -cc1 argument, since nightly test uses
+ // it and developers have been trained to spell it with -mllvm.
+ if (llvm::StringRef(it->getValue(Args, 0)) == "-disable-llvm-optzns")
+ CmdArgs.push_back("-disable-llvm-optzns");
+ else
+ it->render(Args, CmdArgs);
+ }
if (Output.getType() == types::TY_Dependencies) {
// Handled with other dependency code.