diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2014-08-08 13:44:50 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2014-08-08 13:44:50 +0000 |
commit | e805f44c8f309d03f2f70914419e11de5c9347ee (patch) | |
tree | ea4cf30ed082a68df2a950435681ac6eb5059ed0 /clang/lib/Driver/Tools.cpp | |
parent | 255958391dd53620e9f991f8449703ba3ac1d5d2 (diff) | |
download | llvm-e805f44c8f309d03f2f70914419e11de5c9347ee.zip llvm-e805f44c8f309d03f2f70914419e11de5c9347ee.tar.gz llvm-e805f44c8f309d03f2f70914419e11de5c9347ee.tar.bz2 |
[mips] Add -mabicalls/-mno-abicalls to the driver
Based on a patch by Matheus Almeida. I've added testcases and fixed a bug where
the options weren't passed on to GAS.
llvm-svn: 215204
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 86a05cd..303d115 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1040,6 +1040,13 @@ static void getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-n64"); Features.push_back(Args.MakeArgString(ABIFeature)); + // Preserve the current default. + // FIXME: This ought to depend on Triple.getOS() + Features.push_back(Args.MakeArgString("+abicalls")); + + AddTargetFeature(Args, Features, options::OPT_mabicalls, + options::OPT_mno_abicalls, "abicalls"); + StringRef FloatABI = getMipsFloatABI(D, Args); if (FloatABI == "soft") { // FIXME: Note, this is a hack. We need to pass the selected float @@ -7098,6 +7105,11 @@ void gnutools::Assemble::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-mabi"); CmdArgs.push_back(ABIName.data()); + // Preserve the current default + // FIXME: This ought to depend on Triple.getOS(). + CmdArgs.push_back("-mabicalls"); + Args.AddLastArg(CmdArgs, options::OPT_mabicalls, options::OPT_mno_abicalls); + // -mno-shared should be emitted unless -fpic, -fpie, -fPIC, -fPIE, // or -mshared (not implemented) is in effect. bool IsPicOrPie = false; |