diff options
author | Douglas Katzman <dougk@google.com> | 2015-09-08 19:29:55 +0000 |
---|---|---|
committer | Douglas Katzman <dougk@google.com> | 2015-09-08 19:29:55 +0000 |
commit | 38dca8883853e269e12f7cfe12d3722c05798a2c (patch) | |
tree | f9645afce4dd70310b227d2fa57473cd749fab9c /clang/lib/Driver/Tools.cpp | |
parent | 57b2592ace7a493b0c92cbd39a0d05fa920d830f (diff) | |
download | llvm-38dca8883853e269e12f7cfe12d3722c05798a2c.zip llvm-38dca8883853e269e12f7cfe12d3722c05798a2c.tar.gz llvm-38dca8883853e269e12f7cfe12d3722c05798a2c.tar.bz2 |
[Shave]: add a -MT option to moviCompile if there wasn't one
Differential Revision: http://reviews.llvm.org/D12622
llvm-svn: 247052
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index fdb1b18..d9fa2e2 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -9669,15 +9669,27 @@ void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA, // Append all -I, -iquote, -isystem paths, defines/undefines, // 'f' flags, optimize flags, and warning options. // These are spelled the same way in clang and moviCompile. - Args.AddAllArgs(CmdArgs, - {options::OPT_I_Group, options::OPT_clang_i_Group, - options::OPT_D, options::OPT_U, - options::OPT_f_Group, - options::OPT_f_clang_Group, - options::OPT_g_Group, - options::OPT_M_Group, - options::OPT_O_Group, - options::OPT_W_Group}); + Args.AddAllArgs(CmdArgs, {options::OPT_I_Group, options::OPT_clang_i_Group, + options::OPT_D, options::OPT_U, + options::OPT_f_Group, options::OPT_f_clang_Group, + options::OPT_g_Group, options::OPT_M_Group, + options::OPT_O_Group, options::OPT_W_Group}); + + // If we're producing a dependency file, and assembly is the final action, + // then the name of the target in the dependency file should be the '.o' + // file, not the '.s' file produced by this step. For example, instead of + // /tmp/mumble.s: mumble.c .../someheader.h + // the filename on the lefthand side should be "mumble.o" + if (Args.getLastArg(options::OPT_MF) && !Args.getLastArg(options::OPT_MT) && + C.getActions().size() == 1 && + C.getActions()[0]->getKind() == Action::AssembleJobClass) { + Arg *A = Args.getLastArg(options::OPT_o); + if (A) { + CmdArgs.push_back("-MT"); + CmdArgs.push_back(Args.MakeArgString(A->getValue())); + } + } + CmdArgs.push_back("-fno-exceptions"); // Always do this even if unspecified. CmdArgs.push_back(II.getFilename()); |