]> granicus.if.org Git - llvm/commitdiff
ADT: add a helper to check if the Triple is ARM64
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 28 Oct 2017 19:15:05 +0000 (19:15 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 28 Oct 2017 19:15:05 +0000 (19:15 +0000)
Add a trivial helper for checking if the architecture is AArch64 Little
Endian or Big Endian.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316837 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Triple.h

index cb73dcabdbd645d71e3ee9a0fa697c0cbea3f2b6..c2dd5f6fb739ec9b33612f9064ccf23a685a6a20 100644 (file)
@@ -655,6 +655,11 @@ public:
     return getArch() == Triple::arm || getArch() == Triple::armeb;
   }
 
+  /// Tests whether the target is AArch64 (little and big endian).
+  bool isAArch64() const {
+    return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be;
+  }
+
   /// Tests wether the target supports comdat
   bool supportsCOMDAT() const { return !isOSBinFormatMachO(); }