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