[PATCH] D21069: [mips] Require that ABI's are passed in the triple within LLVM.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 02:36:22 PDT 2016


dsanders updated this revision to Diff 63786.
dsanders added a dependency: D20916: [WIP][mips] Allow explicit ABI's in MIPS triples within LLVM..
dsanders added a comment.

Refreshed patch.

At this point we're down to two (was three) camps of targets and can prove this
due to the addition of the assertion. Once the buildbots are cleared, it's safe
to further migrate to a single camp.

The remaining camps are:

- Targets that pass ABI information in both the triple and MCTargetOptions (ARM/PowerPC)
- Targets that pass ABI information in the triple only (Mips/X86/everyone-else).


http://reviews.llvm.org/D21069

Files:
  lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp

Index: lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
===================================================================
--- lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
+++ lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
@@ -49,14 +49,9 @@
 
 MipsABIInfo MipsABIInfo::computeTargetABI(const Triple &TT, StringRef CPU,
                                           const MCTargetOptions &Options) {
-  if (Options.getABIName().startswith("o32"))
-    return MipsABIInfo::O32();
-  else if (Options.getABIName().startswith("n32"))
-    return MipsABIInfo::N32();
-  else if (Options.getABIName().startswith("n64"))
-    return MipsABIInfo::N64();
-  else if (!Options.getABIName().empty())
-    llvm_unreachable("Unknown ABI option for MIPS");
+  if (!Options.getABIName().empty())
+    llvm_unreachable(
+        "ABI name should be in triple. See Triple::getABIVariant()");
   else if (TT.getEnvironment() == Triple::ABI32 ||
            TT.getEnvironment() == Triple::GNUABI32)
     return MipsABIInfo::O32();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21069.63786.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160713/e537d02c/attachment.bin>


More information about the llvm-commits mailing list