[Triple] Add isThumb and isARM functions.

Summary:
isThumb returns true for Thumb triples (little and big endian), isARM
returns true for ARM triples (little and big endian).
There are a few more checks using arm/thumb that are not covered by
those functions, e.g. that the architecture is either ARM or Thumb
(little endian) or ARM/Thumb little endian only.

Reviewers: javed.absar, rengolin, kristof.beyls, t.p.northover

Reviewed By: rengolin

Subscribers: llvm-commits, aemerson

Differential Revision: https://reviews.llvm.org/D34682

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Florian Hahn
2017-08-12 17:40:18 +00:00
parent c05af7aa8c
commit ace970e5d2
6 changed files with 15 additions and 15 deletions
+1 -2
View File
@@ -260,8 +260,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const {
std::string Triple;
// Default to ARM, but use the triple if it's been set.
if (TheTriple.getArch() == Triple::thumb ||
TheTriple.getArch() == Triple::thumbeb)
if (TheTriple.isThumb())
Triple = "thumb";
else
Triple = "arm";