LLVM 24.0.0git
Triple.h
Go to the documentation of this file.
1//===-- llvm/TargetParser/Triple.h - Target triple helper class--*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_TARGETPARSER_TRIPLE_H
10#define LLVM_TARGETPARSER_TRIPLE_H
11
12#include "llvm/ADT/StringRef.h"
16
17// Some system headers or GCC predefined macros conflict with identifiers in
18// this file. Undefine them here.
19#undef NetBSD
20#undef mips
21#undef sparc
22
23namespace llvm {
24enum class ExceptionHandling;
25class Twine;
26
27/// Triple - Helper class for working with autoconf configuration names. For
28/// historical reasons, we also call these 'triples' (they used to contain
29/// exactly three fields).
30///
31/// Configuration names are strings in the canonical form:
32/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM
33/// or
34/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
35///
36/// This class is used for clients which want to support arbitrary
37/// configuration names, but also want to implement certain special
38/// behavior for particular configurations. This class isolates the mapping
39/// from the components of the configuration name to well known IDs.
40///
41/// At its core the Triple class is designed to be a wrapper for a triple
42/// string; the constructor does not change or normalize the triple string.
43/// Clients that need to handle the non-canonical triples that users often
44/// specify should use the normalize method.
45///
46/// See autoconf/config.guess for a glimpse into what configuration names
47/// look like in practice.
48class Triple {
49public:
50 enum ArchType {
52
53 arm, // ARM (little endian): arm, armv.*, xscale
54 armeb, // ARM (big endian): armeb
55 aarch64, // AArch64 (little endian): aarch64
56 aarch64_be, // AArch64 (big endian): aarch64_be
57 aarch64_32, // AArch64 (little endian) ILP32: aarch64_32
58 arc, // ARC: Synopsys ARC
59 avr, // AVR: Atmel AVR microcontroller
60 bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
61 bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
62 csky, // CSKY: csky
63 dxil, // DXIL 32-bit DirectX bytecode
64 hexagon, // Hexagon: hexagon
65 loongarch32, // LoongArch (32-bit): loongarch32
66 loongarch64, // LoongArch (64-bit): loongarch64
67 m68k, // M68k: Motorola 680x0 family
68 mips, // MIPS: mips, mipsallegrex, mipsr6
69 mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
70 mips64, // MIPS64: mips64, mips64r6, mipsn32, mipsn32r6
71 mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
72 msp430, // MSP430: msp430
73 nanomips, // nanoMIPS (little endian): nanomips
74 ppc, // PPC: powerpc
75 ppcle, // PPCLE: powerpc (little endian)
76 ppc64, // PPC64: powerpc64, ppu
77 ppc64le, // PPC64LE: powerpc64le
78 r600, // R600: AMD GPUs HD2XXX - HD6XXX
79 amdgpu, // AMDGPU: AMD GCN+ GPUs
80 riscv32, // RISC-V (32-bit, little endian): riscv32
81 riscv64, // RISC-V (64-bit, little endian): riscv64
82 riscv32be, // RISC-V (32-bit, big endian): riscv32be
83 riscv64be, // RISC-V (64-bit, big endian): riscv64be
84 sparc, // Sparc: sparc
85 sparcv9, // Sparcv9: Sparcv9
86 sparcel, // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant
87 systemz, // SystemZ: s390x
88 // OpenASIP (http://openasip.org) / big endian 32b targets: tce
90 // OpenASIP (http://openasip.org) / little endian 32b targets: tcele
92 // OpenASIP (http://openasip.org) / little endian 64b targets: tcele
94 thumb, // Thumb (little endian): thumb, thumbv.*
95 thumbeb, // Thumb (big endian): thumbeb
96 x86, // X86: i[3-9]86
97 x86_64, // X86-64: amd64, x86_64
98 xcore, // XCore: xcore
99 xtensa, // Tensilica: Xtensa
100 nvptx, // NVPTX: 32-bit
101 nvptx64, // NVPTX: 64-bit
102 amdil, // AMDIL
103 amdil64, // AMDIL with 64-bit pointers
104 hsail, // AMD HSAIL
105 hsail64, // AMD HSAIL with 64-bit pointers
106 spir, // SPIR: standard portable IR for OpenCL 32-bit version
107 spir64, // SPIR: standard portable IR for OpenCL 64-bit version
108 spirv, // SPIR-V with logical memory layout.
109 spirv32, // SPIR-V with 32-bit pointers
110 spirv64, // SPIR-V with 64-bit pointers
111 kalimba, // Kalimba: generic kalimba
112 shave, // SHAVE: Movidius vector VLIW processors
113 lanai, // Lanai: Lanai 32-bit
114 wasm32, // WebAssembly with 32-bit pointers
115 wasm64, // WebAssembly with 64-bit pointers
116 renderscript32, // 32-bit RenderScript
117 renderscript64, // 64-bit RenderScript
118 ve, // NEC SX-Aurora Vector Engine
120 };
123
160
165
167
171
173
175
176 // SPIR-V sub-arch corresponds to its version.
184
185 // DXIL sub-arch corresponds to its version.
198
199 // AMDGPU sub-arch
204
212
218
219 // 810 is its own major arch.
221
229
230 // 908 and 90a are not covered by a generic target, and are their own major
231 // subarches.
234
238
244
253
264
269
273
278
283 };
304 enum OSType {
306
314 Lv2, // PS3
326 CUDA, // NVIDIA CUDA
327 NVCL, // NVIDIA OpenCL
328 AMDHSA, // AMD HSA Runtime
332 TvOS, // Apple tvOS
333 WatchOS, // Apple watchOS
334 BridgeOS, // Apple bridgeOS
335 DriverKit, // Apple DriverKit
336 XROS, // Apple XROS
338 AMDPAL, // AMD PAL Runtime
339 HermitCore, // HermitCore Unikernel/Multikernel
340 Hurd, // GNU/Hurd
341 WASI, // Deprecated alias of WASI 0.1; in the future will be WASI 1.0.
342 WASIp1, // WASI 0.1
343 WASIp2, // WASI 0.2
344 WASIp3, // WASI 0.3
346 ShaderModel, // DirectX ShaderModel
349 Vulkan, // Vulkan SPIR-V
357 };
360
388
393 Simulator, // Simulator variants of other systems, e.g., Apple's iOS
394 MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
395
396 // Shader Stages
397 // The order of these values matters, and must be kept in sync with the
398 // language options enum in Clang. The ordering is enforced in
399 // static_asserts in Triple.cpp and in Clang.
418
422 };
435
436private:
437 std::string Data;
438
439 /// The parsed arch type.
440 ArchType Arch{};
441
442 /// The parsed subarchitecture type.
443 SubArchType SubArch{};
444
445 /// The parsed vendor type.
446 VendorType Vendor{};
447
448 /// The parsed OS type.
449 OSType OS{};
450
451 /// The parsed Environment type.
452 EnvironmentType Environment{};
453
454 /// The object format type.
455 ObjectFormatType ObjectFormat{};
456
457public:
458 /// @name Constructors
459 /// @{
460
461 /// Default constructor is the same as an empty string and leaves all
462 /// triple fields unknown.
463 Triple() = default;
464
465 LLVM_ABI explicit Triple(std::string &&Str);
466 explicit Triple(StringRef Str) : Triple(Str.str()) {}
467 explicit Triple(const char *Str) : Triple(std::string(Str)) {}
468 explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}
469 LLVM_ABI explicit Triple(const Twine &Str);
470
471 LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
472 const Twine &OSStr);
473 LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
474 const Twine &OSStr, const Twine &EnvironmentStr);
475 LLVM_ABI Triple(ArchType A, SubArchType SA = NoSubArch,
476 VendorType V = UnknownVendor, OSType OS = UnknownOS);
477 LLVM_ABI Triple(ArchType A, SubArchType SA, VendorType V, OSType OS,
478 EnvironmentType E);
479 LLVM_ABI Triple(ArchType A, SubArchType SA, VendorType V, OSType OS,
480 EnvironmentType E, ObjectFormatType OF);
481
482 LLVM_ABI bool operator==(const Triple &Other) const;
483 bool operator!=(const Triple &Other) const { return !(*this == Other); }
484
485 LLVM_ABI bool operator<(const Triple &Other) const;
486
487 /// @}
488 /// @name Normalization
489 /// @{
490
491 /// Canonical form
492 enum class CanonicalForm {
493 ANY = 0,
494 THREE_IDENT = 3, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM
495 FOUR_IDENT = 4, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
496 FIVE_IDENT = 5, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT-FORMAT
497 };
498
499 /// Turn an arbitrary machine specification into the canonical triple form (or
500 /// something sensible that the Triple class understands if nothing better can
501 /// reasonably be done). In particular, it handles the common case in which
502 /// otherwise valid components are in the wrong order. \p Form is used to
503 /// specify the output canonical form.
504 LLVM_ABI static std::string
506
507 /// Return the normalized form of this triple's string.
508 std::string normalize(CanonicalForm Form = CanonicalForm::ANY) const {
509 return normalize(Data, Form);
510 }
511
512 /// @}
513 /// @name Typed Component Access
514 /// @{
515
516 /// Get the parsed architecture type of this triple.
517 ArchType getArch() const { return Arch; }
518
519 /// get the parsed subarchitecture type for this triple.
520 SubArchType getSubArch() const { return SubArch; }
521
522 /// Get the parsed vendor type of this triple.
523 VendorType getVendor() const { return Vendor; }
524
525 /// Get the parsed operating system type of this triple.
526 OSType getOS() const { return OS; }
527
528 /// Does this triple have the optional environment (fourth) component?
529 bool hasEnvironment() const { return getEnvironmentName() != ""; }
530
531 /// Get the parsed environment type of this triple.
532 EnvironmentType getEnvironment() const { return Environment; }
533
534 /// Parse the version number from the OS name component of the
535 /// triple, if present.
536 ///
537 /// For example, "fooos1.2.3" would return (1, 2, 3).
539
540 /// Get the object format for this triple.
541 ObjectFormatType getObjectFormat() const { return ObjectFormat; }
542
543 /// Parse the version number from the OS name component of the triple, if
544 /// present.
545 ///
546 /// For example, "fooos1.2.3" would return (1, 2, 3).
548
549 /// Return just the major version number, this is specialized because it is a
550 /// common query.
551 unsigned getOSMajorVersion() const { return getOSVersion().getMajor(); }
552
553 /// Parse the version number as with getOSVersion and then translate generic
554 /// "darwin" versions to the corresponding OS X versions. This may also be
555 /// called with IOS triples but the OS X version number is just set to a
556 /// constant 10.4.0 in that case. Returns true if successful.
558
559 /// Parse the version number as with getOSVersion. This should only be called
560 /// with IOS or generic triples.
562
563 /// Parse the version number as with getOSVersion. This should only be called
564 /// with WatchOS or generic triples.
566
567 /// Parse the version number as with getOSVersion.
569
570 /// Parse the Vulkan version number from the OSVersion and SPIR-V version
571 /// (SubArch). This should only be called with Vulkan SPIR-V triples.
573
574 /// Parse the DXIL version number from the OSVersion and DXIL version
575 /// (SubArch). This should only be called with DXIL triples.
577
578 /// @}
579 /// @name Direct Component Access
580 /// @{
581
582 const std::string &str() const { return Data; }
583
584 const std::string &getTriple() const { return Data; }
585
586 /// Whether the triple is empty / default constructed.
587 bool empty() const { return Data.empty(); }
588
589 /// Get the architecture (first) component of the triple.
591
592 /// Get the vendor (second) component of the triple.
594
595 /// Get the operating system (third) component of the triple.
597
598 /// Get the optional environment (fourth) component of the triple, or "" if
599 /// empty.
601
602 /// Get the operating system and optional environment components as a single
603 /// string (separated by a '-' if the environment component is present).
605
606 /// Get the version component of the environment component as a single
607 /// string (the version after the environment).
608 ///
609 /// For example, "fooos1.2.3" would return "1.2.3".
611
612 /// @}
613 /// @name Convenience Predicates
614 /// @{
615
616 /// Returns the pointer width of this architecture.
618
619 /// Returns the pointer width of this architecture.
620 unsigned getArchPointerBitWidth() const {
622 }
623
624 /// Returns the trampoline size in bytes for this configuration.
625 LLVM_ABI unsigned getTrampolineSize() const;
626
627 /// Test whether the architecture is 64-bit
628 ///
629 /// Note that this tests for 64-bit pointer width, and nothing else. Note
630 /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
631 /// 16-bit. The inner details of pointer width for particular architectures
632 /// is not summed up in the triple, and so only a coarse grained predicate
633 /// system is provided.
634 LLVM_ABI bool isArch64Bit() const;
635
636 /// Test whether the architecture is 32-bit
637 ///
638 /// Note that this tests for 32-bit pointer width, and nothing else.
639 LLVM_ABI bool isArch32Bit() const;
640
641 /// Test whether the architecture is 16-bit
642 ///
643 /// Note that this tests for 16-bit pointer width, and nothing else.
644 LLVM_ABI bool isArch16Bit() const;
645
646 /// Helper function for doing comparisons against version numbers included in
647 /// the target triple.
648 bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
649 unsigned Micro = 0) const {
650 if (Minor == 0) {
651 return getOSVersion() < VersionTuple(Major);
652 }
653 if (Micro == 0) {
654 return getOSVersion() < VersionTuple(Major, Minor);
655 }
656 return getOSVersion() < VersionTuple(Major, Minor, Micro);
657 }
658
659 bool isOSVersionGE(unsigned Major, unsigned Minor = 0,
660 unsigned Micro = 0) const {
661 return !isOSVersionLT(Major, Minor, Micro);
662 }
663
664 bool isOSVersionLT(const Triple &Other) const {
665 return getOSVersion() < Other.getOSVersion();
666 }
667
668 bool isOSVersionGE(const Triple &Other) const {
669 return getOSVersion() >= Other.getOSVersion();
670 }
671
672 /// Comparison function for checking OS X version compatibility, which handles
673 /// supporting skewed version numbering schemes used by the "darwin" triples.
674 LLVM_ABI bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
675 unsigned Micro = 0) const;
676
677 bool isMacOSXVersionGE(unsigned Major, unsigned Minor = 0,
678 unsigned Micro = 0) const {
679 return !isMacOSXVersionLT(Major, Minor, Micro);
680 }
681
682 /// Is this a Mac OS X triple. For legacy reasons, we support both "darwin"
683 /// and "osx" as OS X triples.
684 bool isMacOSX() const {
685 return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
686 }
687
688 /// Is this an iOS triple.
689 /// Note: This identifies tvOS as a variant of iOS. If that ever
690 /// changes, i.e., if the two operating systems diverge or their version
691 /// numbers get out of sync, that will need to be changed.
692 /// watchOS has completely different version numbers so it is not included.
693 bool isiOS() const { return getOS() == Triple::IOS || isTvOS(); }
694
695 /// Is this an Apple tvOS triple.
696 bool isTvOS() const { return getOS() == Triple::TvOS; }
697
698 /// Is this an Apple watchOS triple.
699 bool isWatchOS() const { return getOS() == Triple::WatchOS; }
700
701 bool isWatchABI() const { return getSubArch() == Triple::ARMSubArch_v7k; }
702
703 /// Is this an Apple XROS triple.
704 bool isXROS() const { return getOS() == Triple::XROS; }
705
706 /// Is this an Apple BridgeOS triple.
707 bool isBridgeOS() const { return getOS() == Triple::BridgeOS; }
708
709 /// Is this an Apple DriverKit triple.
710 bool isDriverKit() const { return getOS() == Triple::DriverKit; }
711
712 bool isOSzOS() const { return getOS() == Triple::ZOS; }
713
714 /// Is this an Apple MachO triple.
715 bool isAppleMachO() const {
716 return (getVendor() == Triple::Apple) && isOSBinFormatMachO();
717 }
718
719 /// Is this an Apple firmware triple.
720 bool isAppleFirmware() const {
721 return (getVendor() == Triple::Apple) && isOSFirmware();
722 }
723
724 /// Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or
725 /// bridgeOS).
726 bool isOSDarwin() const {
727 return isMacOSX() || isiOS() || isWatchOS() || isDriverKit() || isXROS() ||
729 // Apple firmware isn't necessarily a Darwin based OS, but for most intents
730 // and purposes it can be treated like a Darwin OS in the compiler.
731 }
732
735 }
736
738 return getEnvironment() == Triple::MacABI;
739 }
740
741 /// Returns true for targets that run on a macOS machine.
742 bool isTargetMachineMac() const {
743 return isMacOSX() || (isOSDarwin() && (isSimulatorEnvironment() ||
745 }
746
747 bool isOSNetBSD() const { return getOS() == Triple::NetBSD; }
748
749 bool isOSOpenBSD() const { return getOS() == Triple::OpenBSD; }
750
751 bool isOSFreeBSD() const { return getOS() == Triple::FreeBSD; }
752
753 bool isOSFuchsia() const { return getOS() == Triple::Fuchsia; }
754
755 bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
756
757 bool isOSSolaris() const { return getOS() == Triple::Solaris; }
758
759 bool isOSIAMCU() const { return getOS() == Triple::ELFIAMCU; }
760
761 bool isOSUnknown() const { return getOS() == Triple::UnknownOS; }
762
763 bool isGNUEnvironment() const {
765 return Env == Triple::GNU || Env == Triple::GNUT64 ||
766 Env == Triple::GNUABIN32 || Env == Triple::GNUABI64 ||
767 Env == Triple::GNUEABI || Env == Triple::GNUEABIT64 ||
768 Env == Triple::GNUEABIHF || Env == Triple::GNUEABIHFT64 ||
769 Env == Triple::GNUF32 || Env == Triple::GNUF64 ||
770 Env == Triple::GNUSF || Env == Triple::GNUX32;
771 }
772
773 /// Tests whether the OS is Haiku.
774 bool isOSHaiku() const { return getOS() == Triple::Haiku; }
775
776 /// Tests whether the OS is UEFI.
777 bool isUEFI() const { return getOS() == Triple::UEFI; }
778
779 /// Tests whether the OS is Windows.
780 bool isOSWindows() const { return getOS() == Triple::Win32; }
781
782 /// Tests whether the OS is Windows or UEFI. These targets generally share
783 /// Windows low-level platform ABI conventions, but this does not imply
784 /// support for a hosted Windows environment or its runtime libraries. Use
785 /// object format or environment predicates when those properties matter.
786 bool isOSWindowsOrUEFI() const { return isOSWindows() || isUEFI(); }
787
788 /// Checks if the environment is MSVC.
790 return isOSWindows() && getEnvironment() == Triple::MSVC;
791 }
792
793 /// Checks if the environment could be MSVC.
798
799 // Checks if we're using the Windows Arm64EC ABI.
800 bool isWindowsArm64EC() const {
801 return getArch() == Triple::aarch64 &&
803 }
804
807 }
808
811 }
812
815 }
816
818 return isOSWindows() && getEnvironment() == Triple::GNU;
819 }
820
821 /// Tests for either Cygwin or MinGW OS
822 bool isOSCygMing() const {
824 }
825
826 /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
831
832 /// Tests whether the OS is Linux.
833 bool isOSLinux() const { return getOS() == Triple::Linux; }
834
835 /// Tests whether the OS is kFreeBSD.
836 bool isOSKFreeBSD() const { return getOS() == Triple::KFreeBSD; }
837
838 /// Tests whether the OS is Hurd.
839 bool isOSHurd() const { return getOS() == Triple::Hurd; }
840
841 /// Tests whether the OS is WASI.
842 bool isOSWASI() const {
843 return getOS() == Triple::WASI || getOS() == Triple::WASIp1 ||
845 }
846
847 /// Tests whether the OS is Emscripten.
848 bool isOSEmscripten() const { return getOS() == Triple::Emscripten; }
849
850 /// Tests whether the OS uses glibc.
851 bool isOSGlibc() const {
852 return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
853 getOS() == Triple::Hurd) &&
855 }
856
857 /// Tests whether the OS is AIX.
858 bool isOSAIX() const { return getOS() == Triple::AIX; }
859
860 bool isOSSerenity() const { return getOS() == Triple::Serenity; }
861
862 /// Tests whether the OS is QURT.
863 bool isOSQurt() const { return getOS() == Triple::QURT; }
864
865 /// Tests whether the OS is H2.
866 bool isOSH2() const { return getOS() == Triple::H2; }
867
868 /// Tests whether the OS uses the ELF binary format.
869 bool isOSBinFormatELF() const { return getObjectFormat() == Triple::ELF; }
870
871 /// Tests whether the OS uses the COFF binary format.
872 bool isOSBinFormatCOFF() const { return getObjectFormat() == Triple::COFF; }
873
874 /// Tests whether the OS uses the GOFF binary format.
875 bool isOSBinFormatGOFF() const { return getObjectFormat() == Triple::GOFF; }
876
877 /// Tests whether the environment is MachO.
879
880 /// Tests whether the OS uses the Wasm binary format.
881 bool isOSBinFormatWasm() const { return getObjectFormat() == Triple::Wasm; }
882
883 /// Tests whether the OS uses the XCOFF binary format.
885
886 /// Tests whether the OS uses the DXContainer binary format.
889 }
890
891 /// Tests whether the target uses WALI Wasm
892 bool isWALI() const {
893 return getArch() == Triple::wasm32 && isOSLinux() &&
895 }
896
897 /// Tests whether the target is the PS4 platform.
898 bool isPS4() const {
899 return getArch() == Triple::x86_64 && getVendor() == Triple::SCEI &&
900 getOS() == Triple::PS4;
901 }
902
903 /// Tests whether the target is the PS5 platform.
904 bool isPS5() const {
905 return getArch() == Triple::x86_64 && getVendor() == Triple::SCEI &&
906 getOS() == Triple::PS5;
907 }
908
909 /// Tests whether the target is the PS4 or PS5 platform.
910 bool isPS() const { return isPS4() || isPS5(); }
911
912 /// Tests whether the target is Android
913 bool isAndroid() const { return getEnvironment() == Triple::Android; }
914
915 bool isAndroidVersionLT(unsigned Major) const {
916 assert(isAndroid() && "Not an Android triple!");
917
919
920 // 64-bit targets did not exist before API level 21 (Lollipop).
921 if (isArch64Bit() && Version.getMajor() < 21)
922 return VersionTuple(21) < VersionTuple(Major);
923
924 return Version < VersionTuple(Major);
925 }
926
927 /// Tests whether the environment is mlibc.
928 bool isMlibc() const { return getEnvironment() == Triple::Mlibc; }
929
930 /// Tests whether the environment is musl-libc
943
944 /// Tests whether the target is OHOS
945 /// LiteOS default enviroment is also OHOS, but omited on triple.
946 bool isOHOSFamily() const { return isOpenHOS() || isOSLiteOS(); }
947
948 bool isOpenHOS() const { return getEnvironment() == Triple::OpenHOS; }
949
950 bool isOSLiteOS() const { return getOS() == Triple::LiteOS; }
951
952 /// Tests whether the target is DXIL.
953 bool isDXIL() const { return getArch() == Triple::dxil; }
954
955 bool isShaderModelOS() const { return getOS() == Triple::ShaderModel; }
956
957 bool isVulkanOS() const { return getOS() == Triple::Vulkan; }
958
959 bool isOSManagarm() const { return getOS() == Triple::Managarm; }
960
961 bool isOSFirmware() const { return getOS() == Triple::Firmware; }
962
965 return Env == Triple::Pixel || Env == Triple::Vertex ||
966 Env == Triple::Geometry || Env == Triple::Hull ||
967 Env == Triple::Domain || Env == Triple::Compute ||
968 Env == Triple::Library || Env == Triple::RayGeneration ||
969 Env == Triple::Intersection || Env == Triple::AnyHit ||
970 Env == Triple::ClosestHit || Env == Triple::Miss ||
971 Env == Triple::Callable || Env == Triple::Mesh ||
973 }
974
975 /// Tests whether the target is SPIR (32- or 64-bit).
976 bool isSPIR() const {
977 return getArch() == Triple::spir || getArch() == Triple::spir64;
978 }
979
980 /// Tests whether the target is SPIR-V (32/64-bit/Logical).
981 bool isSPIRV() const {
982 return getArch() == Triple::spirv32 || getArch() == Triple::spirv64 ||
984 }
985
986 // Tests whether the target is SPIR-V or SPIR.
987 bool isSPIROrSPIRV() const { return isSPIR() || isSPIRV(); }
988
989 /// Tests whether the target is SPIR-V Logical
990 bool isSPIRVLogical() const { return getArch() == Triple::spirv; }
991
992 /// Tests whether the target is NVPTX (32- or 64-bit).
993 bool isNVPTX() const {
994 return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
995 }
996
997 /// Tests whether the target is AMDGCN
998 bool isAMDGCN() const { return getArch() == Triple::amdgpu; }
999
1000 bool isAMDGPU() const { return isAMDGCN() || getArch() == Triple::r600; }
1001
1002 /// Tests whether the target is Thumb (little and big endian).
1003 bool isThumb() const {
1004 return getArch() == Triple::thumb || getArch() == Triple::thumbeb;
1005 }
1006
1007 /// Tests whether the target is ARM (little and big endian).
1008 bool isARM() const {
1009 return getArch() == Triple::arm || getArch() == Triple::armeb;
1010 }
1011
1012 /// Tests whether the target is LFI.
1013 bool isLFI() const {
1014 return (getArch() == Triple::aarch64 &&
1016 (getArch() == Triple::x86_64 &&
1018 }
1019
1020 /// Tests whether the target supports the EHABI exception
1021 /// handling standard.
1036
1037 // ARM EABI is the bare-metal EABI described in ARM ABI documents and
1038 // can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
1039 // FIXME: Add a flag for bare-metal for that target and set Triple::EABI
1040 // even for GNUEABI, so we can make a distinction here and still conform to
1041 // the EABI on GNU (and Android) mode. This requires change in Clang, too.
1042 // FIXME: The Darwin exception is temporary, while we move users to
1043 // "*-*-*-macho" triples as quickly as possible.
1044 bool isTargetAEABI() const {
1045 return (getEnvironment() == Triple::EABI ||
1047 !isOSDarwin() && !isOSWindows();
1048 }
1049
1057
1058 bool isTargetMuslAEABI() const {
1059 return (getEnvironment() == Triple::MuslEABI ||
1062 !isOSDarwin() && !isOSWindows();
1063 }
1064
1065 /// Tests whether the target is T32.
1066 bool isArmT32() const {
1067 switch (getSubArch()) {
1079 return false;
1080 default:
1081 return true;
1082 }
1083 }
1084
1085 /// Tests whether the target is an M-class.
1086 bool isArmMClass() const {
1087 switch (getSubArch()) {
1094 return true;
1095 default:
1096 return false;
1097 }
1098 }
1099
1100 /// Tests whether the target is AArch64 (little and big endian).
1101 bool isAArch64() const {
1102 return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be ||
1104 }
1105
1106 /// Tests whether the target is AArch64 and pointers are the size specified by
1107 /// \p PointerWidth.
1108 bool isAArch64(int PointerWidth) const {
1109 assert(PointerWidth == 64 || PointerWidth == 32);
1110 if (!isAArch64())
1111 return false;
1112 return getArch() == Triple::aarch64_32 ||
1114 ? PointerWidth == 32
1115 : PointerWidth == 64;
1116 }
1117
1118 bool isAVR() const { return getArch() == Triple::avr; }
1119
1120 /// Tests whether the target is 32-bit LoongArch.
1121 bool isLoongArch32() const { return getArch() == Triple::loongarch32; }
1122
1123 /// Tests whether the target is 64-bit LoongArch.
1124 bool isLoongArch64() const { return getArch() == Triple::loongarch64; }
1125
1126 /// Tests whether the target is LoongArch (32- and 64-bit).
1127 bool isLoongArch() const { return isLoongArch32() || isLoongArch64(); }
1128
1129 /// Tests whether the target is MIPS 32-bit (little and big endian).
1130 bool isMIPS32() const {
1131 return getArch() == Triple::mips || getArch() == Triple::mipsel;
1132 }
1133
1134 /// Tests whether the target is MIPS 64-bit (little and big endian).
1135 bool isMIPS64() const {
1136 return getArch() == Triple::mips64 || getArch() == Triple::mips64el;
1137 }
1138
1139 /// Tests whether the target is nanoMIPS.
1140 bool isNanoMips() const { return getArch() == Triple::nanomips; }
1141
1142 /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
1143 bool isMIPS() const { return isMIPS32() || isMIPS64(); }
1144
1145 /// Tests whether the target is PowerPC (32- or 64-bit LE or BE).
1146 bool isPPC() const {
1147 return getArch() == Triple::ppc || getArch() == Triple::ppc64 ||
1149 }
1150
1151 /// Tests whether the target is 32-bit PowerPC (little and big endian).
1152 bool isPPC32() const {
1153 return getArch() == Triple::ppc || getArch() == Triple::ppcle;
1154 }
1155
1156 /// Tests whether the target is 64-bit PowerPC (little and big endian).
1157 bool isPPC64() const {
1158 return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le;
1159 }
1160
1161 /// Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
1162 bool isPPC64ELFv2ABI() const {
1163 return (
1164 getArch() == Triple::ppc64 &&
1165 (getOS() == Triple::FreeBSD || getOS() == Triple::OpenBSD || isMusl()));
1166 }
1167
1168 /// Tests whether the target 32-bit PowerPC uses Secure PLT.
1169 bool isPPC32SecurePlt() const {
1170 return ((getArch() == Triple::ppc || getArch() == Triple::ppcle) &&
1171 (getOS() == Triple::FreeBSD || getOS() == Triple::NetBSD ||
1172 getOS() == Triple::OpenBSD || isMusl()));
1173 }
1174
1175 /// Tests whether the target is 32-bit RISC-V.
1176 bool isRISCV32() const {
1178 }
1179
1180 /// Tests whether the target is 64-bit RISC-V.
1181 bool isRISCV64() const {
1183 }
1184
1185 /// Tests whether the target is RISC-V (32- and 64-bit).
1186 bool isRISCV() const { return isRISCV32() || isRISCV64(); }
1187
1188 /// Tests whether the target is 32-bit SPARC (little and big endian).
1189 bool isSPARC32() const {
1190 return getArch() == Triple::sparc || getArch() == Triple::sparcel;
1191 }
1192
1193 /// Tests whether the target is 64-bit SPARC (big endian).
1194 bool isSPARC64() const { return getArch() == Triple::sparcv9; }
1195
1196 /// Tests whether the target is SPARC.
1197 bool isSPARC() const { return isSPARC32() || isSPARC64(); }
1198
1199 /// Tests whether the target is SystemZ.
1200 bool isSystemZ() const { return getArch() == Triple::systemz; }
1201
1202 /// Tests whether the target is x86 (32- or 64-bit).
1203 bool isX86() const {
1204 return getArch() == Triple::x86 || getArch() == Triple::x86_64;
1205 }
1206
1207 /// Tests whether the target is x86 (32-bit).
1208 bool isX86_32() const { return getArch() == Triple::x86; }
1209
1210 /// Tests whether the target is x86 (64-bit).
1211 bool isX86_64() const { return getArch() == Triple::x86_64; }
1212
1213 /// Tests whether the target is VE
1214 bool isVE() const { return getArch() == Triple::ve; }
1215
1216 /// Tests whether the target is wasm (32- and 64-bit).
1217 bool isWasm() const {
1218 return getArch() == Triple::wasm32 || getArch() == Triple::wasm64;
1219 }
1220
1221 // Tests whether the target is CSKY
1222 bool isCSKY() const { return getArch() == Triple::csky; }
1223
1224 /// Tests whether the target is the Apple "arm64e" AArch64 subarch.
1225 bool isArm64e() const {
1226 return getArch() == Triple::aarch64 &&
1228 }
1229
1230 bool isArm64e_x1() const {
1231 return getArch() == Triple::aarch64 &&
1233 }
1234
1235 // Tests whether the target is N32.
1236 bool isABIN32() const {
1238 return Env == Triple::GNUABIN32 || Env == Triple::MuslABIN32;
1239 }
1240
1241 /// Tests whether the target is X32.
1242 bool isX32() const {
1244 return Env == Triple::GNUX32 || Env == Triple::MuslX32;
1245 }
1246
1247 /// Tests whether the target is eBPF.
1248 bool isBPF() const {
1249 return getArch() == Triple::bpfel || getArch() == Triple::bpfeb;
1250 }
1251
1252 /// Tests whether MSVC linker or UEFI targets.
1253 /// Used to default to -mincremental-linker-compatible if we are
1254 /// targeting the MSVC linker or *-uefi triples.
1258
1259 /// Tests if the target forces 64-bit time_t on a 32-bit architecture.
1260 bool isTime64ABI() const {
1262 return Env == Triple::GNUT64 || Env == Triple::GNUEABIT64 ||
1263 Env == Triple::GNUEABIHFT64;
1264 }
1265
1266 /// Returns the default floating-point ABI for this target triple, i.e. the
1267 /// ABI the code generator will resolve FloatABI::Default to. \p ABIName, if
1268 /// given, is the effective target ABI (e.g. "aapcs16" can force hard float on
1269 /// ARM even when the ordinary default is soft).
1271
1272 /// Tests if the target's default floating-point ABI is hard float.
1274
1275 /// Returns the default threading model for this target triple, i.e. the model
1276 /// used when the "thread-model" module flag is absent.
1278
1279 /// Returns the default floating-point format for the "long double" type. A
1280 /// particular module may override this default.
1282
1283 /// Returns the default debugger tuning for this target triple, i.e. the
1284 /// tuning used when the "debugger-tuning" module flag is absent.
1286
1287 /// Tests whether the target supports comdat
1288 bool supportsCOMDAT() const {
1289 return !(isOSBinFormatMachO() || isOSBinFormatXCOFF() ||
1291 }
1292
1293 /// Tests whether the target supports debug entry values.
1295 switch (getArch()) {
1296 case Triple::x86:
1297 case Triple::x86_64:
1298 case Triple::aarch64:
1299 case Triple::arm:
1300 case Triple::armeb:
1301 case Triple::mips:
1302 case Triple::mipsel:
1303 case Triple::mips64:
1304 case Triple::mips64el:
1305 case Triple::riscv32:
1306 case Triple::riscv64:
1307 return true;
1308 default:
1309 return false;
1310 }
1311 }
1312
1313 /// Tests whether the target uses emulated TLS as default.
1314 ///
1315 /// Note: Android API level 29 (10) introduced ELF TLS.
1317 return (isAndroid() && isAndroidVersionLT(29)) || isOSOpenBSD() ||
1319 }
1320
1321 /// True if the target uses TLSDESC by default.
1322 bool hasDefaultTLSDESC() const {
1323 return isAArch64() || (isAndroid() && isRISCV64()) || isOSFuchsia();
1324 }
1325
1326 /// Tests whether the target uses -data-sections as default.
1328 return isOSBinFormatXCOFF() || isWasm();
1329 }
1330
1331 /// Returns the default wchar_t size (in bytes) for this target triple.
1332 LLVM_ABI unsigned getDefaultWCharSize() const;
1333
1334 /// Tests if the environment supports dllimport/export annotations.
1335 bool hasDLLImportExport() const { return isOSWindows() || isPS(); }
1336
1337 /// @}
1338 /// @name Mutators
1339 /// @{
1340
1341 /// Set the architecture (first) component of the triple to a known type.
1342 LLVM_ABI void setArch(ArchType Kind, SubArchType SubArch = NoSubArch);
1343
1344 /// Set the vendor (second) component of the triple to a known type.
1345 LLVM_ABI void setVendor(VendorType Kind);
1346
1347 /// Set the operating system (third) component of the triple to a known type.
1348 LLVM_ABI void setOS(OSType Kind);
1349
1350 /// Set the environment (fourth) component of the triple to a known type.
1351 LLVM_ABI void setEnvironment(EnvironmentType Kind);
1352
1353 /// Set the object file format.
1354 LLVM_ABI void setObjectFormat(ObjectFormatType Kind);
1355
1356 /// Set all components to the new triple \p Str.
1357 LLVM_ABI void setTriple(const Twine &Str);
1358
1359 /// Set the architecture (first) component of the triple by name.
1360 LLVM_ABI void setArchName(StringRef Str);
1361
1362 /// Set the vendor (second) component of the triple by name.
1364
1365 /// Set the operating system (third) component of the triple by name.
1366 LLVM_ABI void setOSName(StringRef Str);
1367
1368 /// Set the optional environment (fourth) component of the triple by name.
1370
1371 /// Set the operating system and optional environment components with a single
1372 /// string.
1374
1375 /// @}
1376 /// @name Helpers to build variants of a particular triple.
1377 /// @{
1378
1379 /// Form a triple with a 32-bit variant of the current architecture.
1380 ///
1381 /// This can be used to move across "families" of architectures where useful.
1382 ///
1383 /// \returns A new triple with a 32-bit architecture or an unknown
1384 /// architecture if no such variant can be found.
1386
1387 /// Form a triple with a 64-bit variant of the current architecture.
1388 ///
1389 /// This can be used to move across "families" of architectures where useful.
1390 ///
1391 /// \returns A new triple with a 64-bit architecture or an unknown
1392 /// architecture if no such variant can be found.
1394
1395 /// Form a triple with a big endian variant of the current architecture.
1396 ///
1397 /// This can be used to move across "families" of architectures where useful.
1398 ///
1399 /// \returns A new triple with a big endian architecture or an unknown
1400 /// architecture if no such variant can be found.
1402
1403 /// Form a triple with a little endian variant of the current architecture.
1404 ///
1405 /// This can be used to move across "families" of architectures where useful.
1406 ///
1407 /// \returns A new triple with a little endian architecture or an unknown
1408 /// architecture if no such variant can be found.
1410
1411 /// Tests whether the target triple is little endian.
1412 ///
1413 /// \returns true if the triple is little endian, false otherwise.
1414 LLVM_ABI bool isLittleEndian() const;
1415
1416 /// Test whether target triples are compatible.
1417 LLVM_ABI bool isCompatibleWith(const Triple &Other) const;
1418
1419 /// Test whether the target triple is for a GPU.
1420 bool isGPU() const { return isSPIROrSPIRV() || isNVPTX() || isAMDGPU(); }
1421
1422 /// Merge target triples.
1423 LLVM_ABI std::string merge(const Triple &Other) const;
1424
1425 /// Some platforms have different minimum supported OS versions that
1426 /// varies by the architecture specified in the triple. This function
1427 /// returns the minimum supported OS version for this triple if one an exists,
1428 /// or an invalid version tuple if this triple doesn't have one.
1430
1431 /// @}
1432 /// @name Static helpers for IDs.
1433 /// @{
1434
1435 /// Get the canonical name for the \p Kind architecture.
1436 LLVM_ABI static StringRef getArchTypeName(ArchType Kind);
1437
1438 /// Get the architecture name based on \p Kind and \p SubArch.
1439 LLVM_ABI static StringRef getArchName(ArchType Kind,
1440 SubArchType SubArch = NoSubArch);
1441
1442 /// Get the "prefix" canonical name for the \p Kind architecture. This is the
1443 /// prefix used by the architecture specific builtins, and is suitable for
1444 /// passing to \see Intrinsic::getIntrinsicForClangBuiltin().
1445 ///
1446 /// \return - The architecture prefix, or 0 if none is defined.
1447 LLVM_ABI static StringRef getArchTypePrefix(ArchType Kind);
1448
1449 /// Get the canonical name for the \p Kind vendor.
1450 LLVM_ABI static StringRef getVendorTypeName(VendorType Kind);
1451
1452 /// Get the canonical name for the \p Kind operating system.
1453 LLVM_ABI static StringRef getOSTypeName(OSType Kind);
1454
1455 /// Get the canonical name for the \p Kind environment.
1456 LLVM_ABI static StringRef getEnvironmentTypeName(EnvironmentType Kind);
1457
1458 /// Get the name for the \p Object format.
1459 LLVM_ABI static StringRef
1460 getObjectFormatTypeName(ObjectFormatType ObjectFormat);
1461
1462 /// @}
1463 /// @name Static helpers for converting alternate architecture names.
1464 /// @{
1465
1466 /// The canonical type for the given LLVM architecture name (e.g., "x86").
1467 LLVM_ABI static ArchType getArchTypeForLLVMName(StringRef Str);
1468
1469 /// Parse anything recognized as an architecture for the first field of the
1470 /// triple.
1471 LLVM_ABI static ArchType parseArch(StringRef Str);
1472
1473 /// Parse the subarchitecture encoded in the first (architecture) field of the
1474 /// triple (e.g. "amdgpu9.00" -> AMDGPUSubArch900). Returns NoSubArch if the
1475 /// string does not encode a recognized subarchitecture.
1476 LLVM_ABI static SubArchType parseSubArch(StringRef Str);
1477
1478 /// @}
1479
1480 /// Returns a canonicalized OS version number for the specified OS.
1481 LLVM_ABI static VersionTuple
1482 getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version,
1483 bool IsInValidRange);
1484
1485 /// Returns whether an OS version is invalid and would not map to an Apple OS.
1486 LLVM_ABI static bool isValidVersionForOS(OSType OSKind,
1487 const VersionTuple &Version);
1488
1490
1491 /// Compute the LLVM IR data layout string based on the triple. Some targets
1492 /// customize the layout based on the ABIName string.
1493 LLVM_ABI std::string computeDataLayout(StringRef ABIName = "") const;
1494};
1495
1496} // namespace llvm
1497
1498#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:211
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
LLVM_ABI bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Comparison function for checking OS X version compatibility, which handles supporting skewed version ...
Definition Triple.cpp:2349
LLVM_ABI VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition Triple.cpp:1493
bool isPPC() const
Tests whether the target is PowerPC (32- or 64-bit LE or BE).
Definition Triple.h:1146
bool isOSDragonFly() const
Definition Triple.h:755
LLVM_ABI StringRef getVendorName() const
Get the vendor (second) component of the triple.
Definition Triple.cpp:1438
LLVM_ABI VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1613
LLVM_ABI void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
Definition Triple.cpp:1721
LLVM_ABI DebuggerKind getDefaultDebuggerTuning() const
Returns the default debugger tuning for this target triple, i.e.
Definition Triple.cpp:2641
bool isTargetMachineMac() const
Returns true for targets that run on a macOS machine.
Definition Triple.h:742
bool isArmT32() const
Tests whether the target is T32.
Definition Triple.h:1066
LLVM_ABI void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
Definition Triple.cpp:1712
bool isAndroidVersionLT(unsigned Major) const
Definition Triple.h:915
LLVM_ABI llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Definition Triple.cpp:1853
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Definition Triple.h:822
bool isWatchABI() const
Definition Triple.h:701
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
@ RayGeneration
Definition Triple.h:407
@ LastEnvironmentType
Definition Triple.h:421
@ UnknownEnvironment
Definition Triple.h:359
@ RootSignature
Definition Triple.h:415
@ Amplification
Definition Triple.h:414
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
Definition Triple.h:1003
bool isPS4() const
Tests whether the target is the PS4 platform.
Definition Triple.h:898
bool isX86_64() const
Tests whether the target is x86 (64-bit).
Definition Triple.h:1211
bool isPPC64ELFv2ABI() const
Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
Definition Triple.h:1162
static LLVM_ABI VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version, bool IsInValidRange)
Returns a canonicalized OS version number for the specified OS.
Definition Triple.cpp:2403
bool isOSWASI() const
Tests whether the OS is WASI.
Definition Triple.h:842
bool isSPIR() const
Tests whether the target is SPIR (32- or 64-bit).
Definition Triple.h:976
CanonicalForm
Canonical form.
Definition Triple.h:492
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
Definition Triple.h:881
bool isOSQurt() const
Tests whether the OS is QURT.
Definition Triple.h:863
LLVM_ABI bool operator<(const Triple &Other) const
Definition Triple.cpp:31
bool isDriverKit() const
Is this an Apple DriverKit triple.
Definition Triple.h:710
unsigned getArchPointerBitWidth() const
Returns the pointer width of this architecture.
Definition Triple.h:620
LLVM_ABI llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
Definition Triple.cpp:2173
bool isOSHurd() const
Tests whether the OS is Hurd.
Definition Triple.h:839
bool isHardFloatABI() const
Tests if the target's default floating-point ABI is hard float.
Definition Triple.h:1273
bool isBPF() const
Tests whether the target is eBPF.
Definition Triple.h:1248
bool isX32() const
Tests whether the target is X32.
Definition Triple.h:1242
static LLVM_ABI StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
Definition Triple.cpp:384
Triple(const char *Str)
Definition Triple.h:467
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition Triple.h:541
bool isAArch64(int PointerWidth) const
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.
Definition Triple.h:1108
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
Definition Triple.h:520
bool isX86() const
Tests whether the target is x86 (32- or 64-bit).
Definition Triple.h:1203
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition Triple.h:1225
std::string normalize(CanonicalForm Form=CanonicalForm::ANY) const
Return the normalized form of this triple's string.
Definition Triple.h:508
bool isTargetEHABICompatible() const
Tests whether the target supports the EHABI exception handling standard.
Definition Triple.h:1022
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
Definition Triple.h:875
bool isWindowsGNUEnvironment() const
Definition Triple.h:817
LLVM_ABI void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
Definition Triple.cpp:1725
bool isOSNetBSD() const
Definition Triple.h:747
LLVM_ABI std::string computeDataLayout(StringRef ABIName="") const
Compute the LLVM IR data layout string based on the triple.
LLVM_ABI void setOSAndEnvironmentName(StringRef Str)
Set the operating system and optional environment components with a single string.
Definition Triple.cpp:1742
bool isAndroid() const
Tests whether the target is Android.
Definition Triple.h:913
bool hasDefaultTLSDESC() const
True if the target uses TLSDESC by default.
Definition Triple.h:1322
bool isLFI() const
Tests whether the target is LFI.
Definition Triple.h:1013
LLVM_ABI llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
Definition Triple.cpp:1968
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
Definition Triple.h:827
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition Triple.h:878
LLVM_ABI FloatABI::ABIType getDefaultFloatABI(StringRef ABIName="") const
Returns the default floating-point ABI for this target triple, i.e.
Definition Triple.cpp:2556
LLVM_ABI bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition Triple.cpp:2228
LLVM_ABI void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
Definition Triple.cpp:1703
bool isABIN32() const
Definition Triple.h:1236
LLVM_ABI StringRef getOSName() const
Get the operating system (third) component of the triple.
Definition Triple.cpp:1443
bool isAVR() const
Definition Triple.h:1118
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition Triple.h:1288
bool isWindowsCoreCLREnvironment() const
Definition Triple.h:805
bool isSPIROrSPIRV() const
Definition Triple.h:987
LLVM_ABI ExceptionHandling getDefaultExceptionHandling() const
Definition Triple.cpp:2491
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
Definition Triple.h:1135
@ loongarch32
Definition Triple.h:65
@ renderscript64
Definition Triple.h:117
@ UnknownArch
Definition Triple.h:51
@ loongarch64
Definition Triple.h:66
@ renderscript32
Definition Triple.h:116
LLVM_ABI ThreadModel getDefaultThreadModel() const
Returns the default threading model for this target triple, i.e.
Definition Triple.cpp:2571
bool hasDefaultDataSections() const
Tests whether the target uses -data-sections as default.
Definition Triple.h:1327
bool isTargetGNUAEABI() const
Definition Triple.h:1050
bool isOSSolaris() const
Definition Triple.h:757
bool isOSH2() const
Tests whether the OS is H2.
Definition Triple.h:866
bool isRISCV32() const
Tests whether the target is 32-bit RISC-V.
Definition Triple.h:1176
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
Definition Triple.h:836
LLVM_ABI void setTriple(const Twine &Str)
Set all components to the new triple Str.
Definition Triple.cpp:1691
OSType getOS() const
Get the parsed operating system type of this triple.
Definition Triple.h:526
LLVM_ABI VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition Triple.cpp:1466
static LLVM_ABI std::string normalize(StringRef Str, CanonicalForm Form=CanonicalForm::ANY)
Turn an arbitrary machine specification into the canonical triple form (or something sensible that th...
Definition Triple.cpp:1203
static LLVM_ABI ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
Definition Triple.cpp:462
bool isOSVersionLT(const Triple &Other) const
Definition Triple.h:664
bool isPPC32() const
Tests whether the target is 32-bit PowerPC (little and big endian).
Definition Triple.h:1152
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition Triple.h:517
LLVM_ABI bool operator==(const Triple &Other) const
Definition Triple.cpp:25
LLVM_ABI unsigned getTrampolineSize() const
Returns the trampoline size in bytes for this configuration.
Definition Triple.cpp:1823
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition Triple.h:872
bool isRISCV64() const
Tests whether the target is 64-bit RISC-V.
Definition Triple.h:1181
bool isCSKY() const
Definition Triple.h:1222
bool isLoongArch64() const
Tests whether the target is 64-bit LoongArch.
Definition Triple.h:1124
LLVM_ABI StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
Definition Triple.cpp:1449
bool isSPARC32() const
Tests whether the target is 32-bit SPARC (little and big endian).
Definition Triple.h:1189
bool isSimulatorEnvironment() const
Definition Triple.h:733
LLVM_ABI VersionTuple getDXILVersion() const
Parse the DXIL version number from the OSVersion and DXIL version (SubArch).
Definition Triple.cpp:1678
const std::string & str() const
Definition Triple.h:582
bool isOSzOS() const
Definition Triple.h:712
bool isOSSerenity() const
Definition Triple.h:860
bool isOHOSFamily() const
Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.
Definition Triple.h:946
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
Definition Triple.h:532
bool isOSOpenBSD() const
Definition Triple.h:749
LLVM_ABI VersionTuple getVulkanVersion() const
Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
Definition Triple.cpp:1653
bool isOSUnknown() const
Definition Triple.h:761
LLVM_ABI VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1641
static LLVM_ABI ArchType parseArch(StringRef Str)
Parse anything recognized as an architecture for the first field of the triple.
Definition Triple.cpp:602
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
Definition Triple.h:1130
bool isShaderModelOS() const
Definition Triple.h:955
bool isUEFI() const
Tests whether the OS is UEFI.
Definition Triple.h:777
bool isOSWindows() const
Tests whether the OS is Windows.
Definition Triple.h:780
bool isOSFirmware() const
Definition Triple.h:961
bool isMusl() const
Tests whether the environment is musl-libc.
Definition Triple.h:931
const std::string & getTriple() const
Definition Triple.h:584
LLVM_ABI LongDoubleFormat getDefaultLongDoubleFormat() const
Returns the default floating-point format for the "long double" type.
Definition Triple.cpp:2573
bool isOSWindowsOrUEFI() const
Tests whether the OS is Windows or UEFI.
Definition Triple.h:786
static LLVM_ABI StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
Definition Triple.cpp:37
bool isOSVersionGE(const Triple &Other) const
Definition Triple.h:668
bool isOSBinFormatDXContainer() const
Tests whether the OS uses the DXContainer binary format.
Definition Triple.h:887
bool isGPU() const
Test whether the target triple is for a GPU.
Definition Triple.h:1420
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition Triple.h:884
static LLVM_ABI StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
Definition Triple.cpp:397
bool isTargetMuslAEABI() const
Definition Triple.h:1058
@ UnknownObjectFormat
Definition Triple.h:424
bool isARM() const
Tests whether the target is ARM (little and big endian).
Definition Triple.h:1008
LLVM_ABI std::string merge(const Triple &Other) const
Merge target triples.
Definition Triple.cpp:2337
bool isArmMClass() const
Tests whether the target is an M-class.
Definition Triple.h:1086
bool supportsDebugEntryValues() const
Tests whether the target supports debug entry values.
Definition Triple.h:1294
bool isOSLinux() const
Tests whether the OS is Linux.
Definition Triple.h:833
static LLVM_ABI SubArchType parseSubArch(StringRef Str)
Parse the subarchitecture encoded in the first (architecture) field of the triple (e....
Definition Triple.cpp:742
bool isBridgeOS() const
Is this an Apple BridgeOS triple.
Definition Triple.h:707
bool isOSManagarm() const
Definition Triple.h:959
bool isRISCV() const
Tests whether the target is RISC-V (32- and 64-bit).
Definition Triple.h:1186
bool isAMDGCN() const
Tests whether the target is AMDGCN.
Definition Triple.h:998
bool isAMDGPU() const
Definition Triple.h:1000
bool isLoongArch32() const
Tests whether the target is 32-bit LoongArch.
Definition Triple.h:1121
bool isOSLiteOS() const
Definition Triple.h:950
@ UnknownVendor
Definition Triple.h:285
@ ImaginationTechnologies
Definition Triple.h:292
@ LastVendorType
Definition Triple.h:302
@ MipsTechnologies
Definition Triple.h:293
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
Definition Triple.h:993
bool isOSAIX() const
Tests whether the OS is AIX.
Definition Triple.h:858
LLVM_ABI VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Definition Triple.cpp:2366
LLVM_ABI bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition Triple.cpp:1841
LLVM_ABI StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
Definition Triple.cpp:1455
@ ARMSubArch_v6t2
Definition Triple.h:156
@ AMDGPUSubArch600
Definition Triple.h:201
@ MipsSubArch_r6
Definition Triple.h:172
@ X86_64SubArch_lfi
Definition Triple.h:166
@ DXILSubArch_v1_2
Definition Triple.h:188
@ ARMSubArch_v7
Definition Triple.h:147
@ ARMSubArch_v8m_mainline
Definition Triple.h:145
@ AMDGPUSubArch1153
Definition Triple.h:262
@ ARMSubArch_v9_6a
Definition Triple.h:126
@ AMDGPUSubArch1012
Definition Triple.h:242
@ ARMSubArch_v8r
Definition Triple.h:143
@ AMDGPUSubArch1150
Definition Triple.h:259
@ ARMSubArch_v9_1a
Definition Triple.h:131
@ AMDGPUSubArch1250S
Definition Triple.h:275
@ DXILSubArch_v1_1
Definition Triple.h:187
@ AMDGPUSubArch703
Definition Triple.h:209
@ AMDGPUSubArch1201
Definition Triple.h:272
@ LatestDXILSubArch
Definition Triple.h:197
@ FirstAMDGPUSubArch
Definition Triple.h:281
@ SPIRVSubArch_v10
Definition Triple.h:177
@ AMDGPUSubArch9
Definition Triple.h:222
@ SPIRVSubArch_v13
Definition Triple.h:180
@ AMDGPUSubArch1172
Definition Triple.h:268
@ AMDGPUSubArch1035
Definition Triple.h:251
@ DXILSubArch_v1_10
Definition Triple.h:196
@ ARMSubArch_v7k
Definition Triple.h:151
@ AMDGPUSubArch9_4
Definition Triple.h:235
@ AMDGPUSubArch6
Definition Triple.h:200
@ AMDGPUSubArch1033
Definition Triple.h:249
@ AMDGPUSubArch1103
Definition Triple.h:258
@ ARMSubArch_v8_7a
Definition Triple.h:135
@ AMDGPUSubArch1034
Definition Triple.h:250
@ AMDGPUSubArch1154
Definition Triple.h:263
@ ARMSubArch_v8
Definition Triple.h:142
@ SPIRVSubArch_v16
Definition Triple.h:183
@ ARMSubArch_v8_1a
Definition Triple.h:141
@ ARMSubArch_v9_2a
Definition Triple.h:130
@ AMDGPUSubArch1200
Definition Triple.h:271
@ AMDGPUSubArch10_3
Definition Triple.h:245
@ DXILSubArch_v1_3
Definition Triple.h:189
@ ARMSubArch_v9_8a
Definition Triple.h:124
@ SPIRVSubArch_v15
Definition Triple.h:182
@ ARMSubArch_v7m
Definition Triple.h:149
@ AMDGPUSubArch1102
Definition Triple.h:257
@ ARMSubArch_v9_7a
Definition Triple.h:125
@ AMDGPUSubArch1013
Definition Triple.h:243
@ AMDGPUSubArch902
Definition Triple.h:224
@ ARMSubArch_v6k
Definition Triple.h:155
@ AMDGPUSubArch1010
Definition Triple.h:240
@ AMDGPUSubArch90A
Definition Triple.h:233
@ ARMSubArch_v5
Definition Triple.h:157
@ AMDGPUSubArch1170
Definition Triple.h:266
@ AArch64SubArch_arm64e
Definition Triple.h:161
@ AMDGPUSubArch810
Definition Triple.h:220
@ ARMSubArch_v6
Definition Triple.h:153
@ AMDGPUSubArch11
Definition Triple.h:254
@ AMDGPUSubArch1151
Definition Triple.h:260
@ ARMSubArch_v9_5a
Definition Triple.h:127
@ AMDGPUSubArch602
Definition Triple.h:203
@ ARMSubArch_v7ve
Definition Triple.h:152
@ ARMSubArch_v8m_baseline
Definition Triple.h:144
@ ARMSubArch_v8_8a
Definition Triple.h:134
@ AArch64SubArch_arm64e_x1
Definition Triple.h:162
@ AMDGPUSubArch942
Definition Triple.h:236
@ AMDGPUSubArch7
Definition Triple.h:205
@ AMDGPUSubArch702
Definition Triple.h:208
@ AMDGPUSubArch950
Definition Triple.h:237
@ ARMSubArch_v8_2a
Definition Triple.h:140
@ LastAMDGPUSubArch
Definition Triple.h:282
@ ARMSubArch_v7s
Definition Triple.h:150
@ AMDGPUSubArch1251
Definition Triple.h:277
@ AMDGPUSubArch805
Definition Triple.h:217
@ DXILSubArch_v1_0
Definition Triple.h:186
@ DXILSubArch_v1_7
Definition Triple.h:193
@ AMDGPUSubArch12_5
Definition Triple.h:274
@ KalimbaSubArch_v3
Definition Triple.h:168
@ DXILSubArch_v1_5
Definition Triple.h:191
@ AMDGPUSubArch1250
Definition Triple.h:276
@ AMDGPUSubArch1030
Definition Triple.h:246
@ ARMSubArch_v8_4a
Definition Triple.h:138
@ AMDGPUSubArch803
Definition Triple.h:216
@ AMDGPUSubArch601
Definition Triple.h:202
@ ARMSubArch_v8_9a
Definition Triple.h:133
@ AMDGPUSubArch10_1
Definition Triple.h:239
@ AMDGPUSubArch904
Definition Triple.h:225
@ AMDGPUSubArch11_7
Definition Triple.h:265
@ AMDGPUSubArch705
Definition Triple.h:211
@ AMDGPUSubArch802
Definition Triple.h:215
@ AMDGPUSubArch8
Definition Triple.h:213
@ ARMSubArch_v7em
Definition Triple.h:148
@ SPIRVSubArch_v12
Definition Triple.h:179
@ AMDGPUSubArch90C
Definition Triple.h:228
@ SPIRVSubArch_v14
Definition Triple.h:181
@ AMDGPUSubArch1100
Definition Triple.h:255
@ KalimbaSubArch_v4
Definition Triple.h:169
@ AMDGPUSubArch909
Definition Triple.h:227
@ ARMSubArch_v8_1m_mainline
Definition Triple.h:146
@ AMDGPUSubArch1036
Definition Triple.h:252
@ ARMSubArch_v8_3a
Definition Triple.h:139
@ AArch64SubArch_arm64ec
Definition Triple.h:163
@ ARMSubArch_v8_6a
Definition Triple.h:136
@ ARMSubArch_v5te
Definition Triple.h:158
@ KalimbaSubArch_v5
Definition Triple.h:170
@ AMDGPUSubArch701
Definition Triple.h:207
@ ARMSubArch_v4t
Definition Triple.h:159
@ AMDGPUSubArch1171
Definition Triple.h:267
@ DXILSubArch_v1_6
Definition Triple.h:192
@ AMDGPUSubArch1011
Definition Triple.h:241
@ AMDGPUSubArch906
Definition Triple.h:226
@ AMDGPUSubArch900
Definition Triple.h:223
@ AMDGPUSubArch1152
Definition Triple.h:261
@ DXILSubArch_v1_8
Definition Triple.h:194
@ AMDGPUSubArch801
Definition Triple.h:214
@ ARMSubArch_v9_4a
Definition Triple.h:128
@ ARMSubArch_v8_5a
Definition Triple.h:137
@ AArch64SubArch_lfi
Definition Triple.h:164
@ ARMSubArch_v6m
Definition Triple.h:154
@ ARMSubArch_v9_3a
Definition Triple.h:129
@ DXILSubArch_v1_9
Definition Triple.h:195
@ AMDGPUSubArch704
Definition Triple.h:210
@ AMDGPUSubArch1031
Definition Triple.h:247
@ AMDGPUSubArch1101
Definition Triple.h:256
@ ARMSubArch_v9
Definition Triple.h:132
@ AMDGPUSubArch13
Definition Triple.h:279
@ AMDGPUSubArch12
Definition Triple.h:270
@ DXILSubArch_v1_4
Definition Triple.h:190
@ AMDGPUSubArch700
Definition Triple.h:206
@ SPIRVSubArch_v11
Definition Triple.h:178
@ PPCSubArch_spe
Definition Triple.h:174
@ AMDGPUSubArch1032
Definition Triple.h:248
@ AMDGPUSubArch1310
Definition Triple.h:280
@ AMDGPUSubArch908
Definition Triple.h:232
LLVM_ABI bool getMacOSXVersion(VersionTuple &Version) const
Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...
Definition Triple.cpp:1507
bool isSPARC64() const
Tests whether the target is 64-bit SPARC (big endian).
Definition Triple.h:1194
bool isWindowsCygwinEnvironment() const
Definition Triple.h:813
bool isMlibc() const
Tests whether the environment is mlibc.
Definition Triple.h:928
static LLVM_ABI bool isValidVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns whether an OS version is invalid and would not map to an Apple OS.
Definition Triple.cpp:2460
Triple(StringRef Str)
Definition Triple.h:466
bool isMacOSX() const
Is this a Mac OS X triple.
Definition Triple.h:684
Triple(const std::string &Str)
Definition Triple.h:468
bool isOSFreeBSD() const
Definition Triple.h:751
bool isXROS() const
Is this an Apple XROS triple.
Definition Triple.h:704
LLVM_ABI void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
Definition Triple.cpp:1737
LLVM_ABI void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
Definition Triple.cpp:1701
bool isX86_32() const
Tests whether the target is x86 (32-bit).
Definition Triple.h:1208
LLVM_ABI void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
Definition Triple.cpp:1729
bool isAppleFirmware() const
Is this an Apple firmware triple.
Definition Triple.h:720
bool isDefaultIncrementalLinkerCompatibleByDefault() const
Tests whether MSVC linker or UEFI targets.
Definition Triple.h:1255
VendorType getVendor() const
Get the parsed vendor type of this triple.
Definition Triple.h:523
bool isSPARC() const
Tests whether the target is SPARC.
Definition Triple.h:1197
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
Definition Triple.h:1157
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or bridgeOS).
Definition Triple.h:726
bool hasDLLImportExport() const
Tests if the environment supports dllimport/export annotations.
Definition Triple.h:1335
bool isNanoMips() const
Tests whether the target is nanoMIPS.
Definition Triple.h:1140
bool isSPIRVLogical() const
Tests whether the target is SPIR-V Logical.
Definition Triple.h:990
bool isArm64e_x1() const
Definition Triple.h:1230
static LLVM_ABI StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
Definition Triple.cpp:410
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Helper function for doing comparisons against version numbers included in the target triple.
Definition Triple.h:648
bool isTvOS() const
Is this an Apple tvOS triple.
Definition Triple.h:696
bool isOSEmscripten() const
Tests whether the OS is Emscripten.
Definition Triple.h:848
bool isWindowsArm64EC() const
Definition Triple.h:800
bool isOSVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Definition Triple.h:659
bool isWatchOS() const
Is this an Apple watchOS triple.
Definition Triple.h:699
bool empty() const
Whether the triple is empty / default constructed.
Definition Triple.h:587
bool isiOS() const
Is this an iOS triple.
Definition Triple.h:693
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
Definition Triple.h:1143
bool isMacOSXVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Definition Triple.h:677
bool isWALI() const
Tests whether the target uses WALI Wasm.
Definition Triple.h:892
bool isOSGlibc() const
Tests whether the OS uses glibc.
Definition Triple.h:851
bool isTargetAEABI() const
Definition Triple.h:1044
bool isPS() const
Tests whether the target is the PS4 or PS5 platform.
Definition Triple.h:910
bool isWasm() const
Tests whether the target is wasm (32- and 64-bit).
Definition Triple.h:1217
bool isVulkanOS() const
Definition Triple.h:957
LLVM_ABI StringRef getArchName() const
Get the architecture (first) component of the triple.
Definition Triple.cpp:1434
bool isOSIAMCU() const
Definition Triple.h:759
bool isOpenHOS() const
Definition Triple.h:948
bool isMacCatalystEnvironment() const
Definition Triple.h:737
bool isPS5() const
Tests whether the target is the PS5 platform.
Definition Triple.h:904
bool isSPIRV() const
Tests whether the target is SPIR-V (32/64-bit/Logical).
Definition Triple.h:981
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
Definition Triple.h:1101
static LLVM_ABI StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
Definition Triple.cpp:423
bool isAppleMachO() const
Is this an Apple MachO triple.
Definition Triple.h:715
LLVM_ABI bool isArch16Bit() const
Test whether the architecture is 16-bit.
Definition Triple.cpp:1849
LLVM_ABI llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
Definition Triple.cpp:2089
LLVM_ABI VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1561
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
Definition Triple.h:1316
bool isSystemZ() const
Tests whether the target is SystemZ.
Definition Triple.h:1200
LLVM_ABI StringRef getEnvironmentVersionString() const
Get the version component of the environment component as a single string (the version after the envi...
Definition Triple.cpp:1470
bool isPPC32SecurePlt() const
Tests whether the target 32-bit PowerPC uses Secure PLT.
Definition Triple.h:1169
bool isTime64ABI() const
Tests if the target forces 64-bit time_t on a 32-bit architecture.
Definition Triple.h:1260
LLVM_ABI bool isArch32Bit() const
Test whether the architecture is 32-bit.
Definition Triple.cpp:1845
bool operator!=(const Triple &Other) const
Definition Triple.h:483
unsigned getOSMajorVersion() const
Return just the major version number, this is specialized because it is a common query.
Definition Triple.h:551
LLVM_ABI bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
Definition Triple.cpp:2294
bool isOSFuchsia() const
Definition Triple.h:753
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition Triple.h:869
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Definition Triple.h:794
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
Definition Triple.h:529
LLVM_ABI unsigned getDefaultWCharSize() const
Returns the default wchar_t size (in bytes) for this target triple.
Definition Triple.cpp:2282
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
Definition Triple.h:789
static LLVM_ABI StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
Definition Triple.cpp:262
bool isOSHaiku() const
Tests whether the OS is Haiku.
Definition Triple.h:774
LLVM_ABI void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
Definition Triple.cpp:1693
bool isDXIL() const
Tests whether the target is DXIL.
Definition Triple.h:953
LLVM_ABI void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Definition Triple.cpp:1697
bool isGNUEnvironment() const
Definition Triple.h:763
bool isLoongArch() const
Tests whether the target is LoongArch (32- and 64-bit).
Definition Triple.h:1127
bool isShaderStageEnvironment() const
Definition Triple.h:963
bool isWindowsItaniumEnvironment() const
Definition Triple.h:809
bool isVE() const
Tests whether the target is VE.
Definition Triple.h:1214
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
Represents a version number in the form major[.minor[.subminor[.build]]].
unsigned getMajor() const
Retrieve the major version number.
This is an optimization pass for GlobalISel generic memory operations.
LongDoubleFormat
The floating-point format used for the target's "long double" type.
Definition CodeGen.h:117
@ Other
Any other memory.
Definition ModRef.h:68
ThreadModel
The threading model to assume for lowering, e.g. of atomics.
Definition CodeGen.h:191
ExceptionHandling
Definition CodeGen.h:54
DebuggerKind
Identify a debugger for "tuning" the debug info.
Definition CodeGen.h:231
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:879