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 pisa, // PISA: Intel GPU portable ISA (64-bit)
103 amdil, // AMDIL
104 amdil64, // AMDIL with 64-bit pointers
105 hsail, // AMD HSAIL
106 hsail64, // AMD HSAIL with 64-bit pointers
107 spir, // SPIR: standard portable IR for OpenCL 32-bit version
108 spir64, // SPIR: standard portable IR for OpenCL 64-bit version
109 spirv, // SPIR-V with logical memory layout.
110 spirv32, // SPIR-V with 32-bit pointers
111 spirv64, // SPIR-V with 64-bit pointers
112 kalimba, // Kalimba: generic kalimba
113 shave, // SHAVE: Movidius vector VLIW processors
114 lanai, // Lanai: Lanai 32-bit
115 wasm32, // WebAssembly with 32-bit pointers
116 wasm64, // WebAssembly with 64-bit pointers
117 renderscript32, // 32-bit RenderScript
118 renderscript64, // 64-bit RenderScript
119 ve, // NEC SX-Aurora Vector Engine
121 };
124
161
166
168
172
174
176
177 // SPIR-V sub-arch corresponds to its version.
185
186 // DXIL sub-arch corresponds to its version.
199
200 // AMDGPU sub-arch
205
213
219
220 // 810 is its own major arch.
222
230
231 // 908 and 90a are not covered by a generic target, and are their own major
232 // subarches.
235
239
245
254
265
270
274
279
284 };
305 enum OSType {
307
315 Lv2, // PS3
327 CUDA, // NVIDIA CUDA
328 NVCL, // NVIDIA OpenCL
329 AMDHSA, // AMD HSA Runtime
333 TvOS, // Apple tvOS
334 WatchOS, // Apple watchOS
335 BridgeOS, // Apple bridgeOS
336 DriverKit, // Apple DriverKit
337 XROS, // Apple XROS
339 AMDPAL, // AMD PAL Runtime
340 HermitCore, // HermitCore Unikernel/Multikernel
341 Hurd, // GNU/Hurd
342 WASI, // Deprecated alias of WASI 0.1; in the future will be WASI 1.0.
343 WASIp1, // WASI 0.1
344 WASIp2, // WASI 0.2
345 WASIp3, // WASI 0.3
347 ShaderModel, // DirectX ShaderModel
350 Vulkan, // Vulkan SPIR-V
358 };
361
389
394 Simulator, // Simulator variants of other systems, e.g., Apple's iOS
395 MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
396
397 // Shader Stages
398 // The order of these values matters, and must be kept in sync with the
399 // language options enum in Clang. The ordering is enforced in
400 // static_asserts in Triple.cpp and in Clang.
419
423 };
436
437private:
438 std::string Data;
439
440 /// The parsed arch type.
441 ArchType Arch{};
442
443 /// The parsed subarchitecture type.
444 SubArchType SubArch{};
445
446 /// The parsed vendor type.
447 VendorType Vendor{};
448
449 /// The parsed OS type.
450 OSType OS{};
451
452 /// The parsed Environment type.
453 EnvironmentType Environment{};
454
455 /// The object format type.
456 ObjectFormatType ObjectFormat{};
457
458public:
459 /// @name Constructors
460 /// @{
461
462 /// Default constructor is the same as an empty string and leaves all
463 /// triple fields unknown.
464 Triple() = default;
465
466 LLVM_ABI explicit Triple(std::string &&Str);
467 explicit Triple(StringRef Str) : Triple(Str.str()) {}
468 explicit Triple(const char *Str) : Triple(std::string(Str)) {}
469 explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}
470 LLVM_ABI explicit Triple(const Twine &Str);
471
472 LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
473 const Twine &OSStr);
474 LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
475 const Twine &OSStr, const Twine &EnvironmentStr);
476 LLVM_ABI Triple(ArchType A, SubArchType SA = NoSubArch,
477 VendorType V = UnknownVendor, OSType OS = UnknownOS);
478 LLVM_ABI Triple(ArchType A, SubArchType SA, VendorType V, OSType OS,
479 EnvironmentType E);
480 LLVM_ABI Triple(ArchType A, SubArchType SA, VendorType V, OSType OS,
481 EnvironmentType E, ObjectFormatType OF);
482
483 LLVM_ABI bool operator==(const Triple &Other) const;
484 bool operator!=(const Triple &Other) const { return !(*this == Other); }
485
486 LLVM_ABI bool operator<(const Triple &Other) const;
487
488 /// @}
489 /// @name Normalization
490 /// @{
491
492 /// Canonical form
493 enum class CanonicalForm {
494 ANY = 0,
495 THREE_IDENT = 3, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM
496 FOUR_IDENT = 4, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
497 FIVE_IDENT = 5, // ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT-FORMAT
498 };
499
500 /// Turn an arbitrary machine specification into the canonical triple form (or
501 /// something sensible that the Triple class understands if nothing better can
502 /// reasonably be done). In particular, it handles the common case in which
503 /// otherwise valid components are in the wrong order. \p Form is used to
504 /// specify the output canonical form.
505 LLVM_ABI static std::string
507
508 /// Return the normalized form of this triple's string.
509 std::string normalize(CanonicalForm Form = CanonicalForm::ANY) const {
510 return normalize(Data, Form);
511 }
512
513 /// @}
514 /// @name Typed Component Access
515 /// @{
516
517 /// Get the parsed architecture type of this triple.
518 ArchType getArch() const { return Arch; }
519
520 /// get the parsed subarchitecture type for this triple.
521 SubArchType getSubArch() const { return SubArch; }
522
523 /// Get the parsed vendor type of this triple.
524 VendorType getVendor() const { return Vendor; }
525
526 /// Get the parsed operating system type of this triple.
527 OSType getOS() const { return OS; }
528
529 /// Does this triple have the optional environment (fourth) component?
530 bool hasEnvironment() const { return getEnvironmentName() != ""; }
531
532 /// Get the parsed environment type of this triple.
533 EnvironmentType getEnvironment() const { return Environment; }
534
535 /// Parse the version number from the OS name component of the
536 /// triple, if present.
537 ///
538 /// For example, "fooos1.2.3" would return (1, 2, 3).
540
541 /// Get the object format for this triple.
542 ObjectFormatType getObjectFormat() const { return ObjectFormat; }
543
544 /// Parse the version number from the OS name component of the triple, if
545 /// present.
546 ///
547 /// For example, "fooos1.2.3" would return (1, 2, 3).
549
550 /// Return just the major version number, this is specialized because it is a
551 /// common query.
552 unsigned getOSMajorVersion() const { return getOSVersion().getMajor(); }
553
554 /// Parse the version number as with getOSVersion and then translate generic
555 /// "darwin" versions to the corresponding OS X versions. This may also be
556 /// called with IOS triples but the OS X version number is just set to a
557 /// constant 10.4.0 in that case. Returns true if successful.
559
560 /// Parse the version number as with getOSVersion. This should only be called
561 /// with IOS or generic triples.
563
564 /// Parse the version number as with getOSVersion. This should only be called
565 /// with WatchOS or generic triples.
567
568 /// Parse the version number as with getOSVersion.
570
571 /// Parse the Vulkan version number from the OSVersion and SPIR-V version
572 /// (SubArch). This should only be called with Vulkan SPIR-V triples.
574
575 /// Parse the DXIL version number from the OSVersion and DXIL version
576 /// (SubArch). This should only be called with DXIL triples.
578
579 /// @}
580 /// @name Direct Component Access
581 /// @{
582
583 const std::string &str() const { return Data; }
584
585 const std::string &getTriple() const { return Data; }
586
587 /// Whether the triple is empty / default constructed.
588 bool empty() const { return Data.empty(); }
589
590 /// Get the architecture (first) component of the triple.
592
593 /// Get the vendor (second) component of the triple.
595
596 /// Get the operating system (third) component of the triple.
598
599 /// Get the optional environment (fourth) component of the triple, or "" if
600 /// empty.
602
603 /// Get the operating system and optional environment components as a single
604 /// string (separated by a '-' if the environment component is present).
606
607 /// Get the version component of the environment component as a single
608 /// string (the version after the environment).
609 ///
610 /// For example, "fooos1.2.3" would return "1.2.3".
612
613 /// @}
614 /// @name Convenience Predicates
615 /// @{
616
617 /// Returns the pointer width of this architecture.
619
620 /// Returns the pointer width of this architecture.
621 unsigned getArchPointerBitWidth() const {
623 }
624
625 /// Returns the trampoline size in bytes for this configuration.
626 LLVM_ABI unsigned getTrampolineSize() const;
627
628 /// Test whether the architecture is 64-bit
629 ///
630 /// Note that this tests for 64-bit pointer width, and nothing else. Note
631 /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
632 /// 16-bit. The inner details of pointer width for particular architectures
633 /// is not summed up in the triple, and so only a coarse grained predicate
634 /// system is provided.
635 LLVM_ABI bool isArch64Bit() const;
636
637 /// Test whether the architecture is 32-bit
638 ///
639 /// Note that this tests for 32-bit pointer width, and nothing else.
640 LLVM_ABI bool isArch32Bit() const;
641
642 /// Test whether the architecture is 16-bit
643 ///
644 /// Note that this tests for 16-bit pointer width, and nothing else.
645 LLVM_ABI bool isArch16Bit() const;
646
647 /// Helper function for doing comparisons against version numbers included in
648 /// the target triple.
649 bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
650 unsigned Micro = 0) const {
651 if (Minor == 0) {
652 return getOSVersion() < VersionTuple(Major);
653 }
654 if (Micro == 0) {
655 return getOSVersion() < VersionTuple(Major, Minor);
656 }
657 return getOSVersion() < VersionTuple(Major, Minor, Micro);
658 }
659
660 bool isOSVersionGE(unsigned Major, unsigned Minor = 0,
661 unsigned Micro = 0) const {
662 return !isOSVersionLT(Major, Minor, Micro);
663 }
664
665 bool isOSVersionLT(const Triple &Other) const {
666 return getOSVersion() < Other.getOSVersion();
667 }
668
669 bool isOSVersionGE(const Triple &Other) const {
670 return getOSVersion() >= Other.getOSVersion();
671 }
672
673 /// Comparison function for checking OS X version compatibility, which handles
674 /// supporting skewed version numbering schemes used by the "darwin" triples.
675 LLVM_ABI bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
676 unsigned Micro = 0) const;
677
678 bool isMacOSXVersionGE(unsigned Major, unsigned Minor = 0,
679 unsigned Micro = 0) const {
680 return !isMacOSXVersionLT(Major, Minor, Micro);
681 }
682
683 /// Is this a Mac OS X triple. For legacy reasons, we support both "darwin"
684 /// and "osx" as OS X triples.
685 bool isMacOSX() const {
686 return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
687 }
688
689 /// Is this an iOS triple.
690 /// Note: This identifies tvOS as a variant of iOS. If that ever
691 /// changes, i.e., if the two operating systems diverge or their version
692 /// numbers get out of sync, that will need to be changed.
693 /// watchOS has completely different version numbers so it is not included.
694 bool isiOS() const { return getOS() == Triple::IOS || isTvOS(); }
695
696 /// Is this an Apple tvOS triple.
697 bool isTvOS() const { return getOS() == Triple::TvOS; }
698
699 /// Is this an Apple watchOS triple.
700 bool isWatchOS() const { return getOS() == Triple::WatchOS; }
701
702 bool isWatchABI() const { return getSubArch() == Triple::ARMSubArch_v7k; }
703
704 /// Is this an Apple XROS triple.
705 bool isXROS() const { return getOS() == Triple::XROS; }
706
707 /// Is this an Apple BridgeOS triple.
708 bool isBridgeOS() const { return getOS() == Triple::BridgeOS; }
709
710 /// Is this an Apple DriverKit triple.
711 bool isDriverKit() const { return getOS() == Triple::DriverKit; }
712
713 bool isOSzOS() const { return getOS() == Triple::ZOS; }
714
715 /// Is this an Apple MachO triple.
716 bool isAppleMachO() const {
717 return (getVendor() == Triple::Apple) && isOSBinFormatMachO();
718 }
719
720 /// Is this an Apple firmware triple.
721 bool isAppleFirmware() const {
722 return (getVendor() == Triple::Apple) && isOSFirmware();
723 }
724
725 /// Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or
726 /// bridgeOS).
727 bool isOSDarwin() const {
728 return isMacOSX() || isiOS() || isWatchOS() || isDriverKit() || isXROS() ||
730 // Apple firmware isn't necessarily a Darwin based OS, but for most intents
731 // and purposes it can be treated like a Darwin OS in the compiler.
732 }
733
736 }
737
739 return getEnvironment() == Triple::MacABI;
740 }
741
742 /// Returns true for targets that run on a macOS machine.
743 bool isTargetMachineMac() const {
744 return isMacOSX() || (isOSDarwin() && (isSimulatorEnvironment() ||
746 }
747
748 bool isOSNetBSD() const { return getOS() == Triple::NetBSD; }
749
750 bool isOSOpenBSD() const { return getOS() == Triple::OpenBSD; }
751
752 bool isOSFreeBSD() const { return getOS() == Triple::FreeBSD; }
753
754 bool isOSFuchsia() const { return getOS() == Triple::Fuchsia; }
755
756 bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
757
758 bool isOSSolaris() const { return getOS() == Triple::Solaris; }
759
760 bool isOSIAMCU() const { return getOS() == Triple::ELFIAMCU; }
761
762 bool isOSUnknown() const { return getOS() == Triple::UnknownOS; }
763
764 bool isGNUEnvironment() const {
766 return Env == Triple::GNU || Env == Triple::GNUT64 ||
767 Env == Triple::GNUABIN32 || Env == Triple::GNUABI64 ||
768 Env == Triple::GNUEABI || Env == Triple::GNUEABIT64 ||
769 Env == Triple::GNUEABIHF || Env == Triple::GNUEABIHFT64 ||
770 Env == Triple::GNUF32 || Env == Triple::GNUF64 ||
771 Env == Triple::GNUSF || Env == Triple::GNUX32;
772 }
773
774 /// Tests whether the OS is Haiku.
775 bool isOSHaiku() const { return getOS() == Triple::Haiku; }
776
777 /// Tests whether the OS is UEFI.
778 bool isUEFI() const { return getOS() == Triple::UEFI; }
779
780 /// Tests whether the OS is Windows.
781 bool isOSWindows() const { return getOS() == Triple::Win32; }
782
783 /// Tests whether the OS is Windows or UEFI. These targets generally share
784 /// Windows low-level platform ABI conventions, but this does not imply
785 /// support for a hosted Windows environment or its runtime libraries. Use
786 /// object format or environment predicates when those properties matter.
787 bool isOSWindowsOrUEFI() const { return isOSWindows() || isUEFI(); }
788
789 /// Checks if the environment is MSVC.
791 return isOSWindows() && getEnvironment() == Triple::MSVC;
792 }
793
794 /// Checks if the environment could be MSVC.
799
800 // Checks if we're using the Windows Arm64EC ABI.
801 bool isWindowsArm64EC() const {
802 return getArch() == Triple::aarch64 &&
804 }
805
808 }
809
812 }
813
816 }
817
819 return isOSWindows() && getEnvironment() == Triple::GNU;
820 }
821
822 /// Tests for either Cygwin or MinGW OS
823 bool isOSCygMing() const {
825 }
826
827 /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
832
833 /// Tests whether the OS is Linux.
834 bool isOSLinux() const { return getOS() == Triple::Linux; }
835
836 /// Tests whether the OS is kFreeBSD.
837 bool isOSKFreeBSD() const { return getOS() == Triple::KFreeBSD; }
838
839 /// Tests whether the OS is Hurd.
840 bool isOSHurd() const { return getOS() == Triple::Hurd; }
841
842 /// Tests whether the OS is WASI.
843 bool isOSWASI() const {
844 return getOS() == Triple::WASI || getOS() == Triple::WASIp1 ||
846 }
847
848 /// Tests whether the OS is Emscripten.
849 bool isOSEmscripten() const { return getOS() == Triple::Emscripten; }
850
851 /// Tests whether the OS uses glibc.
852 bool isOSGlibc() const {
853 return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
854 getOS() == Triple::Hurd) &&
856 }
857
858 /// Tests whether the OS is AIX.
859 bool isOSAIX() const { return getOS() == Triple::AIX; }
860
861 bool isOSSerenity() const { return getOS() == Triple::Serenity; }
862
863 /// Tests whether the OS is QURT.
864 bool isOSQurt() const { return getOS() == Triple::QURT; }
865
866 /// Tests whether the OS is H2.
867 bool isOSH2() const { return getOS() == Triple::H2; }
868
869 /// Tests whether the OS uses the ELF binary format.
870 bool isOSBinFormatELF() const { return getObjectFormat() == Triple::ELF; }
871
872 /// Tests whether the OS uses the COFF binary format.
873 bool isOSBinFormatCOFF() const { return getObjectFormat() == Triple::COFF; }
874
875 /// Tests whether the OS uses the GOFF binary format.
876 bool isOSBinFormatGOFF() const { return getObjectFormat() == Triple::GOFF; }
877
878 /// Tests whether the environment is MachO.
880
881 /// Tests whether the OS uses the Wasm binary format.
882 bool isOSBinFormatWasm() const { return getObjectFormat() == Triple::Wasm; }
883
884 /// Tests whether the OS uses the XCOFF binary format.
886
887 /// Tests whether the OS uses the DXContainer binary format.
890 }
891
892 /// Tests whether the target uses WALI Wasm
893 bool isWALI() const {
894 return getArch() == Triple::wasm32 && isOSLinux() &&
896 }
897
898 /// Tests whether the target is the PS4 platform.
899 bool isPS4() const {
900 return getArch() == Triple::x86_64 && getVendor() == Triple::SCEI &&
901 getOS() == Triple::PS4;
902 }
903
904 /// Tests whether the target is the PS5 platform.
905 bool isPS5() const {
906 return getArch() == Triple::x86_64 && getVendor() == Triple::SCEI &&
907 getOS() == Triple::PS5;
908 }
909
910 /// Tests whether the target is the PS4 or PS5 platform.
911 bool isPS() const { return isPS4() || isPS5(); }
912
913 /// Tests whether the target is Android
914 bool isAndroid() const { return getEnvironment() == Triple::Android; }
915
916 bool isAndroidVersionLT(unsigned Major) const {
917 assert(isAndroid() && "Not an Android triple!");
918
920
921 // 64-bit targets did not exist before API level 21 (Lollipop).
922 if (isArch64Bit() && Version.getMajor() < 21)
923 return VersionTuple(21) < VersionTuple(Major);
924
925 return Version < VersionTuple(Major);
926 }
927
928 /// Tests whether the environment is mlibc.
929 bool isMlibc() const { return getEnvironment() == Triple::Mlibc; }
930
931 /// Tests whether the environment is musl-libc
944
945 /// Tests whether the target is OHOS
946 /// LiteOS default enviroment is also OHOS, but omited on triple.
947 bool isOHOSFamily() const { return isOpenHOS() || isOSLiteOS(); }
948
949 bool isOpenHOS() const { return getEnvironment() == Triple::OpenHOS; }
950
951 bool isOSLiteOS() const { return getOS() == Triple::LiteOS; }
952
953 /// Tests whether the target is DXIL.
954 bool isDXIL() const { return getArch() == Triple::dxil; }
955
956 bool isShaderModelOS() const { return getOS() == Triple::ShaderModel; }
957
958 bool isVulkanOS() const { return getOS() == Triple::Vulkan; }
959
960 bool isOSManagarm() const { return getOS() == Triple::Managarm; }
961
962 bool isOSFirmware() const { return getOS() == Triple::Firmware; }
963
966 return Env == Triple::Pixel || Env == Triple::Vertex ||
967 Env == Triple::Geometry || Env == Triple::Hull ||
968 Env == Triple::Domain || Env == Triple::Compute ||
969 Env == Triple::Library || Env == Triple::RayGeneration ||
970 Env == Triple::Intersection || Env == Triple::AnyHit ||
971 Env == Triple::ClosestHit || Env == Triple::Miss ||
972 Env == Triple::Callable || Env == Triple::Mesh ||
974 }
975
976 /// Tests whether the target is SPIR (32- or 64-bit).
977 bool isSPIR() const {
978 return getArch() == Triple::spir || getArch() == Triple::spir64;
979 }
980
981 /// Tests whether the target is SPIR-V (32/64-bit/Logical).
982 bool isSPIRV() const {
983 return getArch() == Triple::spirv32 || getArch() == Triple::spirv64 ||
985 }
986
987 // Tests whether the target is SPIR-V or SPIR.
988 bool isSPIROrSPIRV() const { return isSPIR() || isSPIRV(); }
989
990 /// Tests whether the target is SPIR-V Logical
991 bool isSPIRVLogical() const { return getArch() == Triple::spirv; }
992
993 /// Tests whether the target is NVPTX (32- or 64-bit).
994 bool isNVPTX() const {
995 return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
996 }
997
998 /// Tests whether the target is PISA (64-bit only).
999 bool isPISA() const { return getArch() == Triple::pisa; }
1000
1001 /// Tests whether the target is AMDGCN
1002 bool isAMDGCN() const { return getArch() == Triple::amdgpu; }
1003
1004 bool isAMDGPU() const { return isAMDGCN() || getArch() == Triple::r600; }
1005
1006 /// Tests whether the target is Thumb (little and big endian).
1007 bool isThumb() const {
1008 return getArch() == Triple::thumb || getArch() == Triple::thumbeb;
1009 }
1010
1011 /// Tests whether the target is ARM (little and big endian).
1012 bool isARM() const {
1013 return getArch() == Triple::arm || getArch() == Triple::armeb;
1014 }
1015
1016 /// Tests whether the target is LFI.
1017 bool isLFI() const {
1018 return (getArch() == Triple::aarch64 &&
1020 (getArch() == Triple::x86_64 &&
1022 }
1023
1024 /// Tests whether the target supports the EHABI exception
1025 /// handling standard.
1040
1041 // ARM EABI is the bare-metal EABI described in ARM ABI documents and
1042 // can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
1043 // FIXME: Add a flag for bare-metal for that target and set Triple::EABI
1044 // even for GNUEABI, so we can make a distinction here and still conform to
1045 // the EABI on GNU (and Android) mode. This requires change in Clang, too.
1046 // FIXME: The Darwin exception is temporary, while we move users to
1047 // "*-*-*-macho" triples as quickly as possible.
1048 bool isTargetAEABI() const {
1049 return (getEnvironment() == Triple::EABI ||
1051 !isOSDarwin() && !isOSWindows();
1052 }
1053
1061
1062 bool isTargetMuslAEABI() const {
1063 return (getEnvironment() == Triple::MuslEABI ||
1066 !isOSDarwin() && !isOSWindows();
1067 }
1068
1069 /// Tests whether the target is T32.
1070 bool isArmT32() const {
1071 switch (getSubArch()) {
1083 return false;
1084 default:
1085 return true;
1086 }
1087 }
1088
1089 /// Tests whether the target is an M-class.
1090 bool isArmMClass() const {
1091 switch (getSubArch()) {
1098 return true;
1099 default:
1100 return false;
1101 }
1102 }
1103
1104 /// Tests whether the target is AArch64 (little and big endian).
1105 bool isAArch64() const {
1106 return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be ||
1108 }
1109
1110 /// Tests whether the target is AArch64 and pointers are the size specified by
1111 /// \p PointerWidth.
1112 bool isAArch64(int PointerWidth) const {
1113 assert(PointerWidth == 64 || PointerWidth == 32);
1114 if (!isAArch64())
1115 return false;
1116 return getArch() == Triple::aarch64_32 ||
1118 ? PointerWidth == 32
1119 : PointerWidth == 64;
1120 }
1121
1122 bool isAVR() const { return getArch() == Triple::avr; }
1123
1124 /// Tests whether the target is 32-bit LoongArch.
1125 bool isLoongArch32() const { return getArch() == Triple::loongarch32; }
1126
1127 /// Tests whether the target is 64-bit LoongArch.
1128 bool isLoongArch64() const { return getArch() == Triple::loongarch64; }
1129
1130 /// Tests whether the target is LoongArch (32- and 64-bit).
1131 bool isLoongArch() const { return isLoongArch32() || isLoongArch64(); }
1132
1133 /// Tests whether the target is MIPS 32-bit (little and big endian).
1134 bool isMIPS32() const {
1135 return getArch() == Triple::mips || getArch() == Triple::mipsel;
1136 }
1137
1138 /// Tests whether the target is MIPS 64-bit (little and big endian).
1139 bool isMIPS64() const {
1140 return getArch() == Triple::mips64 || getArch() == Triple::mips64el;
1141 }
1142
1143 /// Tests whether the target is nanoMIPS.
1144 bool isNanoMips() const { return getArch() == Triple::nanomips; }
1145
1146 /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
1147 bool isMIPS() const { return isMIPS32() || isMIPS64(); }
1148
1149 /// Tests whether the target is PowerPC (32- or 64-bit LE or BE).
1150 bool isPPC() const {
1151 return getArch() == Triple::ppc || getArch() == Triple::ppc64 ||
1153 }
1154
1155 /// Tests whether the target is 32-bit PowerPC (little and big endian).
1156 bool isPPC32() const {
1157 return getArch() == Triple::ppc || getArch() == Triple::ppcle;
1158 }
1159
1160 /// Tests whether the target is 64-bit PowerPC (little and big endian).
1161 bool isPPC64() const {
1162 return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le;
1163 }
1164
1165 /// Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
1166 bool isPPC64ELFv2ABI() const {
1167 return (
1168 getArch() == Triple::ppc64 &&
1169 (getOS() == Triple::FreeBSD || getOS() == Triple::OpenBSD || isMusl()));
1170 }
1171
1172 /// Tests whether the target 32-bit PowerPC uses Secure PLT.
1173 bool isPPC32SecurePlt() const {
1174 return ((getArch() == Triple::ppc || getArch() == Triple::ppcle) &&
1175 (getOS() == Triple::FreeBSD || getOS() == Triple::NetBSD ||
1176 getOS() == Triple::OpenBSD || isMusl()));
1177 }
1178
1179 /// Tests whether the target is 32-bit RISC-V.
1180 bool isRISCV32() const {
1182 }
1183
1184 /// Tests whether the target is 64-bit RISC-V.
1185 bool isRISCV64() const {
1187 }
1188
1189 /// Tests whether the target is RISC-V (32- and 64-bit).
1190 bool isRISCV() const { return isRISCV32() || isRISCV64(); }
1191
1192 /// Tests whether the target is 32-bit SPARC (little and big endian).
1193 bool isSPARC32() const {
1194 return getArch() == Triple::sparc || getArch() == Triple::sparcel;
1195 }
1196
1197 /// Tests whether the target is 64-bit SPARC (big endian).
1198 bool isSPARC64() const { return getArch() == Triple::sparcv9; }
1199
1200 /// Tests whether the target is SPARC.
1201 bool isSPARC() const { return isSPARC32() || isSPARC64(); }
1202
1203 /// Tests whether the target is SystemZ.
1204 bool isSystemZ() const { return getArch() == Triple::systemz; }
1205
1206 /// Tests whether the target is x86 (32- or 64-bit).
1207 bool isX86() const {
1208 return getArch() == Triple::x86 || getArch() == Triple::x86_64;
1209 }
1210
1211 /// Tests whether the target is x86 (32-bit).
1212 bool isX86_32() const { return getArch() == Triple::x86; }
1213
1214 /// Tests whether the target is x86 (64-bit).
1215 bool isX86_64() const { return getArch() == Triple::x86_64; }
1216
1217 /// Tests whether the target is VE
1218 bool isVE() const { return getArch() == Triple::ve; }
1219
1220 /// Tests whether the target is wasm (32- and 64-bit).
1221 bool isWasm() const {
1222 return getArch() == Triple::wasm32 || getArch() == Triple::wasm64;
1223 }
1224
1225 // Tests whether the target is CSKY
1226 bool isCSKY() const { return getArch() == Triple::csky; }
1227
1228 /// Tests whether the target is the Apple "arm64e" AArch64 subarch.
1229 bool isArm64e() const {
1230 return getArch() == Triple::aarch64 &&
1232 }
1233
1234 bool isArm64e_x1() const {
1235 return getArch() == Triple::aarch64 &&
1237 }
1238
1239 // Tests whether the target is N32.
1240 bool isABIN32() const {
1242 return Env == Triple::GNUABIN32 || Env == Triple::MuslABIN32;
1243 }
1244
1245 /// Tests whether the target is X32.
1246 bool isX32() const {
1248 return Env == Triple::GNUX32 || Env == Triple::MuslX32;
1249 }
1250
1251 /// Tests whether the target is eBPF.
1252 bool isBPF() const {
1253 return getArch() == Triple::bpfel || getArch() == Triple::bpfeb;
1254 }
1255
1256 /// Tests whether MSVC linker or UEFI targets.
1257 /// Used to default to -mincremental-linker-compatible if we are
1258 /// targeting the MSVC linker or *-uefi triples.
1262
1263 /// Tests if the target forces 64-bit time_t on a 32-bit architecture.
1264 bool isTime64ABI() const {
1266 return Env == Triple::GNUT64 || Env == Triple::GNUEABIT64 ||
1267 Env == Triple::GNUEABIHFT64;
1268 }
1269
1270 /// Returns the default floating-point ABI for this target triple, i.e. the
1271 /// ABI the code generator will resolve FloatABI::Default to. \p ABIName, if
1272 /// given, is the effective target ABI (e.g. "aapcs16" can force hard float on
1273 /// ARM even when the ordinary default is soft).
1275
1276 /// Tests if the target's default floating-point ABI is hard float.
1278
1279 /// Returns the default threading model for this target triple, i.e. the model
1280 /// used when the "thread-model" module flag is absent.
1282
1283 /// Returns the default floating-point format for the "long double" type. A
1284 /// particular module may override this default.
1286
1287 /// Returns the default debugger tuning for this target triple, i.e. the
1288 /// tuning used when the "debugger-tuning" module flag is absent.
1290
1291 /// Tests whether the target supports comdat
1292 bool supportsCOMDAT() const {
1293 // NVPTX is formatted as ELF, which does support COMDAT, unlike the other
1294 // formats listed here. However, it is compiled to PTX, assembled by ptxas
1295 // into a cubin, which is linked by nvlink, and neither of those tools
1296 // honors COMDAT.
1297 return !(isOSBinFormatMachO() || isOSBinFormatXCOFF() ||
1299 }
1300
1301 /// Tests whether the target supports debug entry values.
1303 switch (getArch()) {
1304 case Triple::x86:
1305 case Triple::x86_64:
1306 case Triple::aarch64:
1307 case Triple::arm:
1308 case Triple::armeb:
1309 case Triple::mips:
1310 case Triple::mipsel:
1311 case Triple::mips64:
1312 case Triple::mips64el:
1313 case Triple::riscv32:
1314 case Triple::riscv64:
1315 return true;
1316 default:
1317 return false;
1318 }
1319 }
1320
1321 /// Tests whether the target uses emulated TLS as default.
1322 ///
1323 /// Note: Android API level 29 (10) introduced ELF TLS.
1325 return (isAndroid() && isAndroidVersionLT(29)) || isOSOpenBSD() ||
1327 }
1328
1329 /// True if the target uses TLSDESC by default.
1330 bool hasDefaultTLSDESC() const {
1331 return isAArch64() || (isAndroid() && isRISCV64()) || isOSFuchsia();
1332 }
1333
1334 /// Tests whether the target's math library may set errno. Targets where
1335 /// math_errhandling never includes MATH_ERRNO, or which have no errno, return
1336 /// false.
1337 LLVM_ABI bool supportsMathErrno() const;
1338
1339 /// Tests whether the target uses -data-sections as default.
1341 return isOSBinFormatXCOFF() || isWasm();
1342 }
1343
1344 /// Returns the default wchar_t size (in bytes) for this target triple.
1345 LLVM_ABI unsigned getDefaultWCharSize() const;
1346
1347 /// Tests if the environment supports dllimport/export annotations.
1348 bool hasDLLImportExport() const { return isOSWindows() || isPS(); }
1349
1350 /// @}
1351 /// @name Mutators
1352 /// @{
1353
1354 /// Set the architecture (first) component of the triple to a known type.
1355 LLVM_ABI void setArch(ArchType Kind, SubArchType SubArch = NoSubArch);
1356
1357 /// Set the vendor (second) component of the triple to a known type.
1358 LLVM_ABI void setVendor(VendorType Kind);
1359
1360 /// Set the operating system (third) component of the triple to a known type.
1361 LLVM_ABI void setOS(OSType Kind);
1362
1363 /// Set the environment (fourth) component of the triple to a known type.
1364 LLVM_ABI void setEnvironment(EnvironmentType Kind);
1365
1366 /// Set the object file format.
1367 LLVM_ABI void setObjectFormat(ObjectFormatType Kind);
1368
1369 /// Set all components to the new triple \p Str.
1370 LLVM_ABI void setTriple(const Twine &Str);
1371
1372 /// Set the architecture (first) component of the triple by name.
1373 LLVM_ABI void setArchName(StringRef Str);
1374
1375 /// Set the vendor (second) component of the triple by name.
1377
1378 /// Set the operating system (third) component of the triple by name.
1379 LLVM_ABI void setOSName(StringRef Str);
1380
1381 /// Set the optional environment (fourth) component of the triple by name.
1383
1384 /// Set the operating system and optional environment components with a single
1385 /// string.
1387
1388 /// @}
1389 /// @name Helpers to build variants of a particular triple.
1390 /// @{
1391
1392 /// Form a triple with a 32-bit variant of the current architecture.
1393 ///
1394 /// This can be used to move across "families" of architectures where useful.
1395 ///
1396 /// \returns A new triple with a 32-bit architecture or an unknown
1397 /// architecture if no such variant can be found.
1399
1400 /// Form a triple with a 64-bit variant of the current architecture.
1401 ///
1402 /// This can be used to move across "families" of architectures where useful.
1403 ///
1404 /// \returns A new triple with a 64-bit architecture or an unknown
1405 /// architecture if no such variant can be found.
1407
1408 /// Form a triple with a big endian variant of the current architecture.
1409 ///
1410 /// This can be used to move across "families" of architectures where useful.
1411 ///
1412 /// \returns A new triple with a big endian architecture or an unknown
1413 /// architecture if no such variant can be found.
1415
1416 /// Form a triple with a little endian variant of the current architecture.
1417 ///
1418 /// This can be used to move across "families" of architectures where useful.
1419 ///
1420 /// \returns A new triple with a little endian architecture or an unknown
1421 /// architecture if no such variant can be found.
1423
1424 /// Tests whether the target triple is little endian.
1425 ///
1426 /// \returns true if the triple is little endian, false otherwise.
1427 LLVM_ABI bool isLittleEndian() const;
1428
1429 /// Test whether target triples are compatible.
1430 LLVM_ABI bool isCompatibleWith(const Triple &Other) const;
1431
1432 /// Test whether the target triple is for a GPU.
1433 bool isGPU() const {
1434 return isSPIROrSPIRV() || isNVPTX() || isPISA() || isAMDGPU();
1435 }
1436
1437 /// Merge target triples.
1438 LLVM_ABI std::string merge(const Triple &Other) const;
1439
1440 /// Some platforms have different minimum supported OS versions that
1441 /// varies by the architecture specified in the triple. This function
1442 /// returns the minimum supported OS version for this triple if one an exists,
1443 /// or an invalid version tuple if this triple doesn't have one.
1445
1446 /// @}
1447 /// @name Static helpers for IDs.
1448 /// @{
1449
1450 /// Get the canonical name for the \p Kind architecture.
1451 LLVM_ABI static StringRef getArchTypeName(ArchType Kind);
1452
1453 /// Get the architecture name based on \p Kind and \p SubArch.
1454 LLVM_ABI static StringRef getArchName(ArchType Kind,
1455 SubArchType SubArch = NoSubArch);
1456
1457 /// Get the "prefix" canonical name for the \p Kind architecture. This is the
1458 /// prefix used by the architecture specific builtins, and is suitable for
1459 /// passing to \see Intrinsic::getIntrinsicForClangBuiltin().
1460 ///
1461 /// \return - The architecture prefix, or 0 if none is defined.
1462 LLVM_ABI static StringRef getArchTypePrefix(ArchType Kind);
1463
1464 /// Get the canonical name for the \p Kind vendor.
1465 LLVM_ABI static StringRef getVendorTypeName(VendorType Kind);
1466
1467 /// Get the canonical name for the \p Kind operating system.
1468 LLVM_ABI static StringRef getOSTypeName(OSType Kind);
1469
1470 /// Get the canonical name for the \p Kind environment.
1471 LLVM_ABI static StringRef getEnvironmentTypeName(EnvironmentType Kind);
1472
1473 /// Get the name for the \p Object format.
1474 LLVM_ABI static StringRef
1475 getObjectFormatTypeName(ObjectFormatType ObjectFormat);
1476
1477 /// @}
1478 /// @name Static helpers for converting alternate architecture names.
1479 /// @{
1480
1481 /// The canonical type for the given LLVM architecture name (e.g., "x86").
1482 LLVM_ABI static ArchType getArchTypeForLLVMName(StringRef Str);
1483
1484 /// Parse anything recognized as an architecture for the first field of the
1485 /// triple.
1486 LLVM_ABI static ArchType parseArch(StringRef Str);
1487
1488 /// Parse the subarchitecture encoded in the first (architecture) field of the
1489 /// triple (e.g. "amdgpu9.00" -> AMDGPUSubArch900). Returns NoSubArch if the
1490 /// string does not encode a recognized subarchitecture.
1491 LLVM_ABI static SubArchType parseSubArch(StringRef Str);
1492
1493 /// @}
1494
1495 /// Returns a canonicalized OS version number for the specified OS.
1496 LLVM_ABI static VersionTuple
1497 getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version,
1498 bool IsInValidRange);
1499
1500 /// Returns whether an OS version is invalid and would not map to an Apple OS.
1501 LLVM_ABI static bool isValidVersionForOS(OSType OSKind,
1502 const VersionTuple &Version);
1503
1505
1506 /// Compute the LLVM IR data layout string based on the triple. Some targets
1507 /// customize the layout based on the ABIName string.
1508 LLVM_ABI std::string computeDataLayout(StringRef ABIName = "") const;
1509};
1510
1511} // namespace llvm
1512
1513#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
bool isPISA() const
Tests whether the target is PISA (64-bit only).
Definition Triple.h:999
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:2395
LLVM_ABI VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition Triple.cpp:1501
bool isPPC() const
Tests whether the target is PowerPC (32- or 64-bit LE or BE).
Definition Triple.h:1150
bool isOSDragonFly() const
Definition Triple.h:756
LLVM_ABI StringRef getVendorName() const
Get the vendor (second) component of the triple.
Definition Triple.cpp:1446
LLVM_ABI VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1621
LLVM_ABI void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
Definition Triple.cpp:1729
LLVM_ABI DebuggerKind getDefaultDebuggerTuning() const
Returns the default debugger tuning for this target triple, i.e.
Definition Triple.cpp:2687
bool isTargetMachineMac() const
Returns true for targets that run on a macOS machine.
Definition Triple.h:743
bool isArmT32() const
Tests whether the target is T32.
Definition Triple.h:1070
LLVM_ABI void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
Definition Triple.cpp:1720
bool isAndroidVersionLT(unsigned Major) const
Definition Triple.h:916
LLVM_ABI llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Definition Triple.cpp:1862
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Definition Triple.h:823
bool isWatchABI() const
Definition Triple.h:702
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
@ RayGeneration
Definition Triple.h:408
@ LastEnvironmentType
Definition Triple.h:422
@ UnknownEnvironment
Definition Triple.h:360
@ RootSignature
Definition Triple.h:416
@ Amplification
Definition Triple.h:415
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
Definition Triple.h:1007
bool isPS4() const
Tests whether the target is the PS4 platform.
Definition Triple.h:899
bool isX86_64() const
Tests whether the target is x86 (64-bit).
Definition Triple.h:1215
bool isPPC64ELFv2ABI() const
Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
Definition Triple.h:1166
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:2449
bool isOSWASI() const
Tests whether the OS is WASI.
Definition Triple.h:843
bool isSPIR() const
Tests whether the target is SPIR (32- or 64-bit).
Definition Triple.h:977
CanonicalForm
Canonical form.
Definition Triple.h:493
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
Definition Triple.h:882
bool isOSQurt() const
Tests whether the OS is QURT.
Definition Triple.h:864
LLVM_ABI bool operator<(const Triple &Other) const
Definition Triple.cpp:31
bool isDriverKit() const
Is this an Apple DriverKit triple.
Definition Triple.h:711
unsigned getArchPointerBitWidth() const
Returns the pointer width of this architecture.
Definition Triple.h:621
LLVM_ABI llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
Definition Triple.cpp:2185
bool isOSHurd() const
Tests whether the OS is Hurd.
Definition Triple.h:840
bool isHardFloatABI() const
Tests if the target's default floating-point ABI is hard float.
Definition Triple.h:1277
bool isBPF() const
Tests whether the target is eBPF.
Definition Triple.h:1252
bool isX32() const
Tests whether the target is X32.
Definition Triple.h:1246
static LLVM_ABI StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
Definition Triple.cpp:389
Triple(const char *Str)
Definition Triple.h:468
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition Triple.h:542
bool isAArch64(int PointerWidth) const
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.
Definition Triple.h:1112
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
Definition Triple.h:521
bool isX86() const
Tests whether the target is x86 (32- or 64-bit).
Definition Triple.h:1207
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition Triple.h:1229
std::string normalize(CanonicalForm Form=CanonicalForm::ANY) const
Return the normalized form of this triple's string.
Definition Triple.h:509
bool isTargetEHABICompatible() const
Tests whether the target supports the EHABI exception handling standard.
Definition Triple.h:1026
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
Definition Triple.h:876
bool isWindowsGNUEnvironment() const
Definition Triple.h:818
LLVM_ABI void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
Definition Triple.cpp:1733
bool isOSNetBSD() const
Definition Triple.h:748
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:1750
bool isAndroid() const
Tests whether the target is Android.
Definition Triple.h:914
bool hasDefaultTLSDESC() const
True if the target uses TLSDESC by default.
Definition Triple.h:1330
bool isLFI() const
Tests whether the target is LFI.
Definition Triple.h:1017
LLVM_ABI llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
Definition Triple.cpp:1978
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
Definition Triple.h:828
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition Triple.h:879
LLVM_ABI FloatABI::ABIType getDefaultFloatABI(StringRef ABIName="") const
Returns the default floating-point ABI for this target triple, i.e.
Definition Triple.cpp:2602
LLVM_ABI bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition Triple.cpp:2240
LLVM_ABI bool supportsMathErrno() const
Tests whether the target's math library may set errno.
Definition Triple.cpp:2307
LLVM_ABI void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
Definition Triple.cpp:1711
bool isABIN32() const
Definition Triple.h:1240
LLVM_ABI StringRef getOSName() const
Get the operating system (third) component of the triple.
Definition Triple.cpp:1451
bool isAVR() const
Definition Triple.h:1122
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition Triple.h:1292
bool isWindowsCoreCLREnvironment() const
Definition Triple.h:806
bool isSPIROrSPIRV() const
Definition Triple.h:988
LLVM_ABI ExceptionHandling getDefaultExceptionHandling() const
Definition Triple.cpp:2537
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
Definition Triple.h:1139
@ loongarch32
Definition Triple.h:65
@ renderscript64
Definition Triple.h:118
@ UnknownArch
Definition Triple.h:51
@ loongarch64
Definition Triple.h:66
@ renderscript32
Definition Triple.h:117
LLVM_ABI ThreadModel getDefaultThreadModel() const
Returns the default threading model for this target triple, i.e.
Definition Triple.cpp:2617
bool hasDefaultDataSections() const
Tests whether the target uses -data-sections as default.
Definition Triple.h:1340
bool isTargetGNUAEABI() const
Definition Triple.h:1054
bool isOSSolaris() const
Definition Triple.h:758
bool isOSH2() const
Tests whether the OS is H2.
Definition Triple.h:867
bool isRISCV32() const
Tests whether the target is 32-bit RISC-V.
Definition Triple.h:1180
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
Definition Triple.h:837
LLVM_ABI void setTriple(const Twine &Str)
Set all components to the new triple Str.
Definition Triple.cpp:1699
OSType getOS() const
Get the parsed operating system type of this triple.
Definition Triple.h:527
LLVM_ABI VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition Triple.cpp:1474
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:1211
static LLVM_ABI ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
Definition Triple.cpp:467
bool isOSVersionLT(const Triple &Other) const
Definition Triple.h:665
bool isPPC32() const
Tests whether the target is 32-bit PowerPC (little and big endian).
Definition Triple.h:1156
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition Triple.h:518
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:1832
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition Triple.h:873
bool isRISCV64() const
Tests whether the target is 64-bit RISC-V.
Definition Triple.h:1185
bool isCSKY() const
Definition Triple.h:1226
bool isLoongArch64() const
Tests whether the target is 64-bit LoongArch.
Definition Triple.h:1128
LLVM_ABI StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
Definition Triple.cpp:1457
bool isSPARC32() const
Tests whether the target is 32-bit SPARC (little and big endian).
Definition Triple.h:1193
bool isSimulatorEnvironment() const
Definition Triple.h:734
LLVM_ABI VersionTuple getDXILVersion() const
Parse the DXIL version number from the OSVersion and DXIL version (SubArch).
Definition Triple.cpp:1686
const std::string & str() const
Definition Triple.h:583
bool isOSzOS() const
Definition Triple.h:713
bool isOSSerenity() const
Definition Triple.h:861
bool isOHOSFamily() const
Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.
Definition Triple.h:947
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
Definition Triple.h:533
bool isOSOpenBSD() const
Definition Triple.h:750
LLVM_ABI VersionTuple getVulkanVersion() const
Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
Definition Triple.cpp:1661
bool isOSUnknown() const
Definition Triple.h:762
LLVM_ABI VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1649
static LLVM_ABI ArchType parseArch(StringRef Str)
Parse anything recognized as an architecture for the first field of the triple.
Definition Triple.cpp:608
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
Definition Triple.h:1134
bool isShaderModelOS() const
Definition Triple.h:956
bool isUEFI() const
Tests whether the OS is UEFI.
Definition Triple.h:778
bool isOSWindows() const
Tests whether the OS is Windows.
Definition Triple.h:781
bool isOSFirmware() const
Definition Triple.h:962
bool isMusl() const
Tests whether the environment is musl-libc.
Definition Triple.h:932
const std::string & getTriple() const
Definition Triple.h:585
LLVM_ABI LongDoubleFormat getDefaultLongDoubleFormat() const
Returns the default floating-point format for the "long double" type.
Definition Triple.cpp:2619
bool isOSWindowsOrUEFI() const
Tests whether the OS is Windows or UEFI.
Definition Triple.h:787
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:669
bool isOSBinFormatDXContainer() const
Tests whether the OS uses the DXContainer binary format.
Definition Triple.h:888
bool isGPU() const
Test whether the target triple is for a GPU.
Definition Triple.h:1433
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition Triple.h:885
static LLVM_ABI StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
Definition Triple.cpp:402
bool isTargetMuslAEABI() const
Definition Triple.h:1062
@ UnknownObjectFormat
Definition Triple.h:425
bool isARM() const
Tests whether the target is ARM (little and big endian).
Definition Triple.h:1012
LLVM_ABI std::string merge(const Triple &Other) const
Merge target triples.
Definition Triple.cpp:2383
bool isArmMClass() const
Tests whether the target is an M-class.
Definition Triple.h:1090
bool supportsDebugEntryValues() const
Tests whether the target supports debug entry values.
Definition Triple.h:1302
bool isOSLinux() const
Tests whether the OS is Linux.
Definition Triple.h:834
static LLVM_ABI SubArchType parseSubArch(StringRef Str)
Parse the subarchitecture encoded in the first (architecture) field of the triple (e....
Definition Triple.cpp:749
bool isBridgeOS() const
Is this an Apple BridgeOS triple.
Definition Triple.h:708
bool isOSManagarm() const
Definition Triple.h:960
bool isRISCV() const
Tests whether the target is RISC-V (32- and 64-bit).
Definition Triple.h:1190
bool isAMDGCN() const
Tests whether the target is AMDGCN.
Definition Triple.h:1002
bool isAMDGPU() const
Definition Triple.h:1004
bool isLoongArch32() const
Tests whether the target is 32-bit LoongArch.
Definition Triple.h:1125
bool isOSLiteOS() const
Definition Triple.h:951
@ UnknownVendor
Definition Triple.h:286
@ ImaginationTechnologies
Definition Triple.h:293
@ LastVendorType
Definition Triple.h:303
@ MipsTechnologies
Definition Triple.h:294
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
Definition Triple.h:994
bool isOSAIX() const
Tests whether the OS is AIX.
Definition Triple.h:859
LLVM_ABI VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Definition Triple.cpp:2412
LLVM_ABI bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition Triple.cpp:1850
LLVM_ABI StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
Definition Triple.cpp:1463
@ ARMSubArch_v6t2
Definition Triple.h:157
@ AMDGPUSubArch600
Definition Triple.h:202
@ MipsSubArch_r6
Definition Triple.h:173
@ X86_64SubArch_lfi
Definition Triple.h:167
@ DXILSubArch_v1_2
Definition Triple.h:189
@ ARMSubArch_v7
Definition Triple.h:148
@ ARMSubArch_v8m_mainline
Definition Triple.h:146
@ AMDGPUSubArch1153
Definition Triple.h:263
@ ARMSubArch_v9_6a
Definition Triple.h:127
@ AMDGPUSubArch1012
Definition Triple.h:243
@ ARMSubArch_v8r
Definition Triple.h:144
@ AMDGPUSubArch1150
Definition Triple.h:260
@ ARMSubArch_v9_1a
Definition Triple.h:132
@ AMDGPUSubArch1250S
Definition Triple.h:276
@ DXILSubArch_v1_1
Definition Triple.h:188
@ AMDGPUSubArch703
Definition Triple.h:210
@ AMDGPUSubArch1201
Definition Triple.h:273
@ LatestDXILSubArch
Definition Triple.h:198
@ FirstAMDGPUSubArch
Definition Triple.h:282
@ SPIRVSubArch_v10
Definition Triple.h:178
@ AMDGPUSubArch9
Definition Triple.h:223
@ SPIRVSubArch_v13
Definition Triple.h:181
@ AMDGPUSubArch1172
Definition Triple.h:269
@ AMDGPUSubArch1035
Definition Triple.h:252
@ DXILSubArch_v1_10
Definition Triple.h:197
@ ARMSubArch_v7k
Definition Triple.h:152
@ AMDGPUSubArch9_4
Definition Triple.h:236
@ AMDGPUSubArch6
Definition Triple.h:201
@ AMDGPUSubArch1033
Definition Triple.h:250
@ AMDGPUSubArch1103
Definition Triple.h:259
@ ARMSubArch_v8_7a
Definition Triple.h:136
@ AMDGPUSubArch1034
Definition Triple.h:251
@ AMDGPUSubArch1154
Definition Triple.h:264
@ ARMSubArch_v8
Definition Triple.h:143
@ SPIRVSubArch_v16
Definition Triple.h:184
@ ARMSubArch_v8_1a
Definition Triple.h:142
@ ARMSubArch_v9_2a
Definition Triple.h:131
@ AMDGPUSubArch1200
Definition Triple.h:272
@ AMDGPUSubArch10_3
Definition Triple.h:246
@ DXILSubArch_v1_3
Definition Triple.h:190
@ ARMSubArch_v9_8a
Definition Triple.h:125
@ SPIRVSubArch_v15
Definition Triple.h:183
@ ARMSubArch_v7m
Definition Triple.h:150
@ AMDGPUSubArch1102
Definition Triple.h:258
@ ARMSubArch_v9_7a
Definition Triple.h:126
@ AMDGPUSubArch1013
Definition Triple.h:244
@ AMDGPUSubArch902
Definition Triple.h:225
@ ARMSubArch_v6k
Definition Triple.h:156
@ AMDGPUSubArch1010
Definition Triple.h:241
@ AMDGPUSubArch90A
Definition Triple.h:234
@ ARMSubArch_v5
Definition Triple.h:158
@ AMDGPUSubArch1170
Definition Triple.h:267
@ AArch64SubArch_arm64e
Definition Triple.h:162
@ AMDGPUSubArch810
Definition Triple.h:221
@ ARMSubArch_v6
Definition Triple.h:154
@ AMDGPUSubArch11
Definition Triple.h:255
@ AMDGPUSubArch1151
Definition Triple.h:261
@ ARMSubArch_v9_5a
Definition Triple.h:128
@ AMDGPUSubArch602
Definition Triple.h:204
@ ARMSubArch_v7ve
Definition Triple.h:153
@ ARMSubArch_v8m_baseline
Definition Triple.h:145
@ ARMSubArch_v8_8a
Definition Triple.h:135
@ AArch64SubArch_arm64e_x1
Definition Triple.h:163
@ AMDGPUSubArch942
Definition Triple.h:237
@ AMDGPUSubArch7
Definition Triple.h:206
@ AMDGPUSubArch702
Definition Triple.h:209
@ AMDGPUSubArch950
Definition Triple.h:238
@ ARMSubArch_v8_2a
Definition Triple.h:141
@ LastAMDGPUSubArch
Definition Triple.h:283
@ ARMSubArch_v7s
Definition Triple.h:151
@ AMDGPUSubArch1251
Definition Triple.h:278
@ AMDGPUSubArch805
Definition Triple.h:218
@ DXILSubArch_v1_0
Definition Triple.h:187
@ DXILSubArch_v1_7
Definition Triple.h:194
@ AMDGPUSubArch12_5
Definition Triple.h:275
@ KalimbaSubArch_v3
Definition Triple.h:169
@ DXILSubArch_v1_5
Definition Triple.h:192
@ AMDGPUSubArch1250
Definition Triple.h:277
@ AMDGPUSubArch1030
Definition Triple.h:247
@ ARMSubArch_v8_4a
Definition Triple.h:139
@ AMDGPUSubArch803
Definition Triple.h:217
@ AMDGPUSubArch601
Definition Triple.h:203
@ ARMSubArch_v8_9a
Definition Triple.h:134
@ AMDGPUSubArch10_1
Definition Triple.h:240
@ AMDGPUSubArch904
Definition Triple.h:226
@ AMDGPUSubArch11_7
Definition Triple.h:266
@ AMDGPUSubArch705
Definition Triple.h:212
@ AMDGPUSubArch802
Definition Triple.h:216
@ AMDGPUSubArch8
Definition Triple.h:214
@ ARMSubArch_v7em
Definition Triple.h:149
@ SPIRVSubArch_v12
Definition Triple.h:180
@ AMDGPUSubArch90C
Definition Triple.h:229
@ SPIRVSubArch_v14
Definition Triple.h:182
@ AMDGPUSubArch1100
Definition Triple.h:256
@ KalimbaSubArch_v4
Definition Triple.h:170
@ AMDGPUSubArch909
Definition Triple.h:228
@ ARMSubArch_v8_1m_mainline
Definition Triple.h:147
@ AMDGPUSubArch1036
Definition Triple.h:253
@ ARMSubArch_v8_3a
Definition Triple.h:140
@ AArch64SubArch_arm64ec
Definition Triple.h:164
@ ARMSubArch_v8_6a
Definition Triple.h:137
@ ARMSubArch_v5te
Definition Triple.h:159
@ KalimbaSubArch_v5
Definition Triple.h:171
@ AMDGPUSubArch701
Definition Triple.h:208
@ ARMSubArch_v4t
Definition Triple.h:160
@ AMDGPUSubArch1171
Definition Triple.h:268
@ DXILSubArch_v1_6
Definition Triple.h:193
@ AMDGPUSubArch1011
Definition Triple.h:242
@ AMDGPUSubArch906
Definition Triple.h:227
@ AMDGPUSubArch900
Definition Triple.h:224
@ AMDGPUSubArch1152
Definition Triple.h:262
@ DXILSubArch_v1_8
Definition Triple.h:195
@ AMDGPUSubArch801
Definition Triple.h:215
@ ARMSubArch_v9_4a
Definition Triple.h:129
@ ARMSubArch_v8_5a
Definition Triple.h:138
@ AArch64SubArch_lfi
Definition Triple.h:165
@ ARMSubArch_v6m
Definition Triple.h:155
@ ARMSubArch_v9_3a
Definition Triple.h:130
@ DXILSubArch_v1_9
Definition Triple.h:196
@ AMDGPUSubArch704
Definition Triple.h:211
@ AMDGPUSubArch1031
Definition Triple.h:248
@ AMDGPUSubArch1101
Definition Triple.h:257
@ ARMSubArch_v9
Definition Triple.h:133
@ AMDGPUSubArch13
Definition Triple.h:280
@ AMDGPUSubArch12
Definition Triple.h:271
@ DXILSubArch_v1_4
Definition Triple.h:191
@ AMDGPUSubArch700
Definition Triple.h:207
@ SPIRVSubArch_v11
Definition Triple.h:179
@ PPCSubArch_spe
Definition Triple.h:175
@ AMDGPUSubArch1032
Definition Triple.h:249
@ AMDGPUSubArch1310
Definition Triple.h:281
@ AMDGPUSubArch908
Definition Triple.h:233
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:1515
bool isSPARC64() const
Tests whether the target is 64-bit SPARC (big endian).
Definition Triple.h:1198
bool isWindowsCygwinEnvironment() const
Definition Triple.h:814
bool isMlibc() const
Tests whether the environment is mlibc.
Definition Triple.h:929
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:2506
Triple(StringRef Str)
Definition Triple.h:467
bool isMacOSX() const
Is this a Mac OS X triple.
Definition Triple.h:685
Triple(const std::string &Str)
Definition Triple.h:469
bool isOSFreeBSD() const
Definition Triple.h:752
bool isXROS() const
Is this an Apple XROS triple.
Definition Triple.h:705
LLVM_ABI void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
Definition Triple.cpp:1745
LLVM_ABI void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
Definition Triple.cpp:1709
bool isX86_32() const
Tests whether the target is x86 (32-bit).
Definition Triple.h:1212
LLVM_ABI void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
Definition Triple.cpp:1737
bool isAppleFirmware() const
Is this an Apple firmware triple.
Definition Triple.h:721
bool isDefaultIncrementalLinkerCompatibleByDefault() const
Tests whether MSVC linker or UEFI targets.
Definition Triple.h:1259
VendorType getVendor() const
Get the parsed vendor type of this triple.
Definition Triple.h:524
bool isSPARC() const
Tests whether the target is SPARC.
Definition Triple.h:1201
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
Definition Triple.h:1161
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or bridgeOS).
Definition Triple.h:727
bool hasDLLImportExport() const
Tests if the environment supports dllimport/export annotations.
Definition Triple.h:1348
bool isNanoMips() const
Tests whether the target is nanoMIPS.
Definition Triple.h:1144
bool isSPIRVLogical() const
Tests whether the target is SPIR-V Logical.
Definition Triple.h:991
bool isArm64e_x1() const
Definition Triple.h:1234
static LLVM_ABI StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
Definition Triple.cpp:415
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:649
bool isTvOS() const
Is this an Apple tvOS triple.
Definition Triple.h:697
bool isOSEmscripten() const
Tests whether the OS is Emscripten.
Definition Triple.h:849
bool isWindowsArm64EC() const
Definition Triple.h:801
bool isOSVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Definition Triple.h:660
bool isWatchOS() const
Is this an Apple watchOS triple.
Definition Triple.h:700
bool empty() const
Whether the triple is empty / default constructed.
Definition Triple.h:588
bool isiOS() const
Is this an iOS triple.
Definition Triple.h:694
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
Definition Triple.h:1147
bool isMacOSXVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
Definition Triple.h:678
bool isWALI() const
Tests whether the target uses WALI Wasm.
Definition Triple.h:893
bool isOSGlibc() const
Tests whether the OS uses glibc.
Definition Triple.h:852
bool isTargetAEABI() const
Definition Triple.h:1048
bool isPS() const
Tests whether the target is the PS4 or PS5 platform.
Definition Triple.h:911
bool isWasm() const
Tests whether the target is wasm (32- and 64-bit).
Definition Triple.h:1221
bool isVulkanOS() const
Definition Triple.h:958
LLVM_ABI StringRef getArchName() const
Get the architecture (first) component of the triple.
Definition Triple.cpp:1442
bool isOSIAMCU() const
Definition Triple.h:760
bool isOpenHOS() const
Definition Triple.h:949
bool isMacCatalystEnvironment() const
Definition Triple.h:738
bool isPS5() const
Tests whether the target is the PS5 platform.
Definition Triple.h:905
bool isSPIRV() const
Tests whether the target is SPIR-V (32/64-bit/Logical).
Definition Triple.h:982
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
Definition Triple.h:1105
static LLVM_ABI StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
Definition Triple.cpp:428
bool isAppleMachO() const
Is this an Apple MachO triple.
Definition Triple.h:716
LLVM_ABI bool isArch16Bit() const
Test whether the architecture is 16-bit.
Definition Triple.cpp:1858
LLVM_ABI llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
Definition Triple.cpp:2100
LLVM_ABI VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition Triple.cpp:1569
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
Definition Triple.h:1324
bool isSystemZ() const
Tests whether the target is SystemZ.
Definition Triple.h:1204
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:1478
bool isPPC32SecurePlt() const
Tests whether the target 32-bit PowerPC uses Secure PLT.
Definition Triple.h:1173
bool isTime64ABI() const
Tests if the target forces 64-bit time_t on a 32-bit architecture.
Definition Triple.h:1264
LLVM_ABI bool isArch32Bit() const
Test whether the architecture is 32-bit.
Definition Triple.cpp:1854
bool operator!=(const Triple &Other) const
Definition Triple.h:484
unsigned getOSMajorVersion() const
Return just the major version number, this is specialized because it is a common query.
Definition Triple.h:552
LLVM_ABI bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
Definition Triple.cpp:2340
bool isOSFuchsia() const
Definition Triple.h:754
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition Triple.h:870
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Definition Triple.h:795
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
Definition Triple.h:530
LLVM_ABI unsigned getDefaultWCharSize() const
Returns the default wchar_t size (in bytes) for this target triple.
Definition Triple.cpp:2295
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
Definition Triple.h:790
static LLVM_ABI StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
Definition Triple.cpp:264
bool isOSHaiku() const
Tests whether the OS is Haiku.
Definition Triple.h:775
LLVM_ABI void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
Definition Triple.cpp:1701
bool isDXIL() const
Tests whether the target is DXIL.
Definition Triple.h:954
LLVM_ABI void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Definition Triple.cpp:1705
bool isGNUEnvironment() const
Definition Triple.h:764
bool isLoongArch() const
Tests whether the target is LoongArch (32- and 64-bit).
Definition Triple.h:1131
bool isShaderStageEnvironment() const
Definition Triple.h:964
bool isWindowsItaniumEnvironment() const
Definition Triple.h:810
bool isVE() const
Tests whether the target is VE.
Definition Triple.h:1218
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