[PATCH] D38799: [mips] Add MIPS ABI enumeration and getter function to the Triple class

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 07:31:13 PDT 2017


atanasyan created this revision.
Herald added subscribers: arichardson, srhines.

MIPS uses multiple ABIs. Now LLVM supports three of them: O32, N32, and N64. The Triple::Environment has items GNU, GNUABIN32, and GNUABI64, but these items do not cover all possible cases. Ideally, we have to add something like AndroidN64, MuslN32, MuslN64 etc.

      

This change selects another approach. It adds MipsABI enumeration to the Triple class and treats MIPS ABI like the SubArchType. To recognize ABI it parses "environmet" component of a target triple and retrieve ABI type from it.

      

This change allows to keep selected MIPS ABI in one place - a target triple. In the next patches I'm going to stop using MCTargetOptions::ABIName for propagating MIPS ABI and to fix some issues which require type of selected MIPS ABI in places where MCTargetOptions::ABIName is not available at all (like MipsMCAsmInfo).


Repository:
  rL LLVM

https://reviews.llvm.org/D38799

Files:
  include/llvm/ADT/Triple.h
  lib/Support/Triple.cpp
  lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
  unittests/ADT/TripleTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38799.118612.patch
Type: text/x-patch
Size: 5746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171011/2d1138c8/attachment.bin>


More information about the llvm-commits mailing list