diff options
Diffstat (limited to 'contrib/llvm/include/llvm/ADT/Triple.h')
-rw-r--r-- | contrib/llvm/include/llvm/ADT/Triple.h | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/contrib/llvm/include/llvm/ADT/Triple.h b/contrib/llvm/include/llvm/ADT/Triple.h index cd560658ca4e..74fc8eb8ccbf 100644 --- a/contrib/llvm/include/llvm/ADT/Triple.h +++ b/contrib/llvm/include/llvm/ADT/Triple.h @@ -50,6 +50,7 @@ public: armeb, // ARM (big endian): armeb aarch64, // AArch64 (little endian): aarch64 aarch64_be, // AArch64 (big endian): aarch64_be + arc, // ARC: Synopsys ARC avr, // AVR: Atmel AVR microcontroller bpfel, // eBPF or extended BPF or 64-bit BPF (little endian) bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian) @@ -100,6 +101,7 @@ public: enum SubArchType { NoSubArch, + ARMSubArch_v8_3a, ARMSubArch_v8_2a, ARMSubArch_v8_1a, ARMSubArch_v8, @@ -167,7 +169,6 @@ public: RTEMS, NaCl, // Native Client CNK, // BG/P Compute-Node Kernel - Bitrig, AIX, CUDA, // NVIDIA CUDA NVCL, // NVIDIA OpenCL @@ -178,12 +179,14 @@ public: WatchOS, // Apple watchOS Mesa3D, Contiki, - LastOSType = Contiki + AMDPAL, // AMD PAL Runtime + LastOSType = AMDPAL }; enum EnvironmentType { UnknownEnvironment, GNU, + GNUABIN32, GNUABI64, GNUEABI, GNUEABIHF, @@ -202,7 +205,8 @@ public: AMDOpenCL, CoreCLR, OpenCL, - LastEnvironmentType = OpenCL + Simulator, // Simulator variants of other systems, e.g., Apple's iOS + LastEnvironmentType = Simulator }; enum ObjectFormatType { UnknownObjectFormat, @@ -467,6 +471,10 @@ public: return isMacOSX() || isiOS() || isWatchOS(); } + bool isSimulatorEnvironment() const { + return getEnvironment() == Triple::Simulator; + } + bool isOSNetBSD() const { return getOS() == Triple::NetBSD; } @@ -489,25 +497,28 @@ public: return getOS() == Triple::Solaris; } - bool isOSBitrig() const { - return getOS() == Triple::Bitrig; - } - bool isOSIAMCU() const { return getOS() == Triple::ELFIAMCU; } + bool isOSUnknown() const { return getOS() == Triple::UnknownOS; } + bool isGNUEnvironment() const { EnvironmentType Env = getEnvironment(); - return Env == Triple::GNU || Env == Triple::GNUABI64 || - Env == Triple::GNUEABI || Env == Triple::GNUEABIHF || - Env == Triple::GNUX32; + return Env == Triple::GNU || Env == Triple::GNUABIN32 || + Env == Triple::GNUABI64 || Env == Triple::GNUEABI || + Env == Triple::GNUEABIHF || Env == Triple::GNUX32; } bool isOSContiki() const { return getOS() == Triple::Contiki; } + /// Tests whether the OS is Haiku. + bool isOSHaiku() const { + return getOS() == Triple::Haiku; + } + /// Checks if the environment could be MSVC. bool isWindowsMSVCEnvironment() const { return getOS() == Triple::Win32 && @@ -634,8 +645,25 @@ public: return getArch() == Triple::nvptx || getArch() == Triple::nvptx64; } + /// Tests whether the target is Thumb (little and big endian). + bool isThumb() const { + return getArch() == Triple::thumb || getArch() == Triple::thumbeb; + } + + /// Tests whether the target is ARM (little and big endian). + bool isARM() const { + 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(); } + bool supportsCOMDAT() const { + return !isOSBinFormatMachO() && !isOSBinFormatWasm(); + } /// @} /// @name Mutators |