summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-07-17 09:46:40 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-07-17 09:46:40 +0000
commit4dcbe810d4f9398d60745f78f0bd0255dbb1b5d1 (patch)
treecb248c6bc87b7eb5ea95d90ec71cedc1771b6203 /clang/lib/Driver
parent7d78ab575357e722bc7b7b96fa39b85722554acb (diff)
downloadbcm5719-llvm-4dcbe810d4f9398d60745f78f0bd0255dbb1b5d1.tar.gz
bcm5719-llvm-4dcbe810d4f9398d60745f78f0bd0255dbb1b5d1.zip
[mips] Pass the ABI to the integrated assembler and add tests the existing arguments.
Summary: With this patch (and a corresponding LLVM patch), assembling an empty file with GCC and Clang -fintegrated-as produce near identical objects. The remaining differences are: * GCC/GAS produce objects have a .pdr section * GCC/GAS produce objects have a .gnu.attributes section Other differences are insignificant such as precise file offsets and the order of strings in the string table. Differential Revision: http://reviews.llvm.org/D4531 llvm-svn: 213241
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/Tools.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index e47db33803a..8f0902d80df 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1036,6 +1036,17 @@ static void getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
mips::getMipsCPUAndABI(Args, Triple, CPUName, ABIName);
ABIName = getGnuCompatibleMipsABIName(ABIName);
+ // Always override the backend's default ABI.
+ StringRef ABIFeature = llvm::StringSwitch<StringRef>(ABIName)
+ .Case("32", "+o32")
+ .Case("n32", "+n32")
+ .Case("64", "+n64")
+ .Case("eabi", "+eabi")
+ .Default(("+" + ABIName).str());
+ Features.push_back("-o32");
+ Features.push_back("-n64");
+ Features.push_back(Args.MakeArgString(ABIFeature));
+
StringRef FloatABI = getMipsFloatABI(D, Args);
if (FloatABI == "soft") {
// FIXME: Note, this is a hack. We need to pass the selected float
OpenPOWER on IntegriCloud