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