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