diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-29 07:18:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-29 07:18:39 +0000 |
commit | f219e7c1529fac29e34483667f740b452e5ef9cc (patch) | |
tree | 66d830651935e8bc26561817275a69bd2623a358 /lib/Driver/Tools.cpp | |
parent | ede538f1875558f54d723925f0e8771043731aaf (diff) |
Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c79b0939da..ed4d39123a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -700,8 +700,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, else Model = getToolChain().GetDefaultRelocationModel(); } - CmdArgs.push_back("-relocation-model"); - CmdArgs.push_back(Model); + if (llvm::StringRef(Model) != "pic") { + CmdArgs.push_back("-mrelocation-model"); + CmdArgs.push_back(Model); + } // Infer the __PIC__ value. // @@ -711,26 +713,29 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-pic-level"); CmdArgs.push_back(Args.hasArg(options::OPT_fPIC) ? "2" : "1"); } + if (!Args.hasFlag(options::OPT_fmerge_all_constants, + options::OPT_fno_merge_all_constants)) + CmdArgs.push_back("-no-merge-all-constants"); + + // LLVM Code Generator Options. - if (Args.hasArg(options::OPT_ftime_report)) - CmdArgs.push_back("-time-passes"); // FIXME: Set --enable-unsafe-fp-math. if (Args.hasFlag(options::OPT_fno_omit_frame_pointer, options::OPT_fomit_frame_pointer)) - CmdArgs.push_back("-disable-fp-elim"); + CmdArgs.push_back("-mdisable-fp-elim"); if (!Args.hasFlag(options::OPT_fzero_initialized_in_bss, - options::OPT_fno_zero_initialized_in_bss, - true)) - CmdArgs.push_back("-nozero-initialized-in-bss"); + options::OPT_fno_zero_initialized_in_bss)) + CmdArgs.push_back("-mno-zero-initialized-in-bss"); if (Args.hasArg(options::OPT_dA) || Args.hasArg(options::OPT_fverbose_asm)) - CmdArgs.push_back("-asm-verbose"); - if (Args.hasArg(options::OPT_fdebug_pass_structure)) - CmdArgs.push_back("-debug-pass=Structure"); - if (Args.hasArg(options::OPT_fdebug_pass_arguments)) - CmdArgs.push_back("-debug-pass=Arguments"); - if (!Args.hasFlag(options::OPT_fmerge_all_constants, - options::OPT_fno_merge_all_constants)) - CmdArgs.push_back("-no-merge-all-constants"); + CmdArgs.push_back("-masm-verbose"); + if (Args.hasArg(options::OPT_fdebug_pass_structure)) { + CmdArgs.push_back("-mdebug-pass"); + CmdArgs.push_back("Structure"); + } + if (Args.hasArg(options::OPT_fdebug_pass_arguments)) { + CmdArgs.push_back("-mdebug-pass"); + CmdArgs.push_back("Arguments"); + } // This is a coarse approximation of what llvm-gcc actually does, both // -fasynchronous-unwind-tables and -fnon-call-exceptions interact in more @@ -742,15 +747,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, !Args.hasArg(options::OPT_mkernel)); if (Args.hasFlag(options::OPT_funwind_tables, options::OPT_fno_unwind_tables, AsynchronousUnwindTables)) - CmdArgs.push_back("-unwind-tables=1"); - else - CmdArgs.push_back("-unwind-tables=0"); + CmdArgs.push_back("-munwind-tables"); + + if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) { + CmdArgs.push_back("-mlimit-float-precision"); + CmdArgs.push_back(A->getValue(Args)); + } // FIXME: Handle -mtune=. (void) Args.hasArg(options::OPT_mtune_EQ); if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) { - CmdArgs.push_back("-code-model"); + CmdArgs.push_back("-mcode-model"); CmdArgs.push_back(A->getValue(Args)); } @@ -776,11 +784,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, getToolChain().IsMathErrnoDefault())) CmdArgs.push_back("-fno-math-errno"); - if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) { - CmdArgs.push_back("-limit-float-precision"); - CmdArgs.push_back(A->getValue(Args)); - } - Arg *Unsupported; if ((Unsupported = Args.getLastArg(options::OPT_MG)) || (Unsupported = Args.getLastArg(options::OPT_MQ)) || |