Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.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/Twine.h"
13#include "llvm/Support/VersionTuple.h"
14
15// Some system headers or GCC predefined macros conflict with identifiers in
16// this file. Undefine them here.
17#undef NetBSD
18#undef mips
19#undef sparc
20
21namespacellvm {
22
23/// Triple - Helper class for working with autoconf configuration names. For
24/// historical reasons, we also call these 'triples' (they used to contain
25/// exactly three fields).
26///
27/// Configuration names are strings in the canonical form:
28/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM
29/// or
30/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
31///
32/// This class is used for clients which want to support arbitrary
33/// configuration names, but also want to implement certain special
34/// behavior for particular configurations. This class isolates the mapping
35/// from the components of the configuration name to well known IDs.
36///
37/// At its core the Triple class is designed to be a wrapper for a triple
38/// string; the constructor does not change or normalize the triple string.
39/// Clients that need to handle the non-canonical triples that users often
40/// specify should use the normalize method.
41///
42/// See autoconf/config.guess for a glimpse into what configuration names
43/// look like in practice.
44classTriple {
45public:
46enumArchType {
47UnknownArch,
48
49arm,// ARM (little endian): arm, armv.*, xscale
50armeb,// ARM (big endian): armeb
51aarch64,// AArch64 (little endian): aarch64
52aarch64_be,// AArch64 (big endian): aarch64_be
53aarch64_32,// AArch64 (little endian) ILP32: aarch64_32
54arc,// ARC: Synopsys ARC
55avr,// AVR: Atmel AVR microcontroller
56bpfel,// eBPF or extended BPF or 64-bit BPF (little endian)
57bpfeb,// eBPF or extended BPF or 64-bit BPF (big endian)
58csky,// CSKY: csky
59dxil,// DXIL 32-bit DirectX bytecode
60hexagon,// Hexagon: hexagon
61loongarch32,// LoongArch (32-bit): loongarch32
62loongarch64,// LoongArch (64-bit): loongarch64
63m68k,// M68k: Motorola 680x0 family
64mips,// MIPS: mips, mipsallegrex, mipsr6
65mipsel,// MIPSEL: mipsel, mipsallegrexe, mipsr6el
66mips64,// MIPS64: mips64, mips64r6, mipsn32, mipsn32r6
67mips64el,// MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
68msp430,// MSP430: msp430
69ppc,// PPC: powerpc
70ppcle,// PPCLE: powerpc (little endian)
71ppc64,// PPC64: powerpc64, ppu
72ppc64le,// PPC64LE: powerpc64le
73r600,// R600: AMD GPUs HD2XXX - HD6XXX
74amdgcn,// AMDGCN: AMD GCN GPUs
75riscv32,// RISC-V (32-bit): riscv32
76riscv64,// RISC-V (64-bit): riscv64
77sparc,// Sparc: sparc
78sparcv9,// Sparcv9: Sparcv9
79sparcel,// Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant
80systemz,// SystemZ: s390x
81tce,// TCE (http://tce.cs.tut.fi/): tce
82tcele,// TCE little endian (http://tce.cs.tut.fi/): tcele
83thumb,// Thumb (little endian): thumb, thumbv.*
84thumbeb,// Thumb (big endian): thumbeb
85x86,// X86: i[3-9]86
86x86_64,// X86-64: amd64, x86_64
87xcore,// XCore: xcore
88xtensa,// Tensilica: Xtensa
89nvptx,// NVPTX: 32-bit
90nvptx64,// NVPTX: 64-bit
91amdil,// AMDIL
92amdil64,// AMDIL with 64-bit pointers
93hsail,// AMD HSAIL
94hsail64,// AMD HSAIL with 64-bit pointers
95spir,// SPIR: standard portable IR for OpenCL 32-bit version
96spir64,// SPIR: standard portable IR for OpenCL 64-bit version
97spirv,// SPIR-V with logical memory layout.
98spirv32,// SPIR-V with 32-bit pointers
99spirv64,// SPIR-V with 64-bit pointers
100kalimba,// Kalimba: generic kalimba
101shave,// SHAVE: Movidius vector VLIW processors
102lanai,// Lanai: Lanai 32-bit
103wasm32,// WebAssembly with 32-bit pointers
104wasm64,// WebAssembly with 64-bit pointers
105renderscript32,// 32-bit RenderScript
106renderscript64,// 64-bit RenderScript
107ve,// NEC SX-Aurora Vector Engine
108LastArchType =ve
109 };
110enumSubArchType {
111NoSubArch,
112
113ARMSubArch_v9_6a,
114ARMSubArch_v9_5a,
115ARMSubArch_v9_4a,
116ARMSubArch_v9_3a,
117ARMSubArch_v9_2a,
118ARMSubArch_v9_1a,
119ARMSubArch_v9,
120ARMSubArch_v8_9a,
121ARMSubArch_v8_8a,
122ARMSubArch_v8_7a,
123ARMSubArch_v8_6a,
124ARMSubArch_v8_5a,
125ARMSubArch_v8_4a,
126ARMSubArch_v8_3a,
127ARMSubArch_v8_2a,
128ARMSubArch_v8_1a,
129ARMSubArch_v8,
130ARMSubArch_v8r,
131ARMSubArch_v8m_baseline,
132ARMSubArch_v8m_mainline,
133ARMSubArch_v8_1m_mainline,
134ARMSubArch_v7,
135ARMSubArch_v7em,
136ARMSubArch_v7m,
137ARMSubArch_v7s,
138ARMSubArch_v7k,
139ARMSubArch_v7ve,
140ARMSubArch_v6,
141ARMSubArch_v6m,
142ARMSubArch_v6k,
143ARMSubArch_v6t2,
144ARMSubArch_v5,
145ARMSubArch_v5te,
146ARMSubArch_v4t,
147
148AArch64SubArch_arm64e,
149AArch64SubArch_arm64ec,
150
151KalimbaSubArch_v3,
152KalimbaSubArch_v4,
153KalimbaSubArch_v5,
154
155MipsSubArch_r6,
156
157PPCSubArch_spe,
158
159// SPIR-V sub-arch corresponds to its version.
160SPIRVSubArch_v10,
161SPIRVSubArch_v11,
162SPIRVSubArch_v12,
163SPIRVSubArch_v13,
164SPIRVSubArch_v14,
165SPIRVSubArch_v15,
166SPIRVSubArch_v16,
167
168// DXIL sub-arch corresponds to its version.
169DXILSubArch_v1_0,
170DXILSubArch_v1_1,
171DXILSubArch_v1_2,
172DXILSubArch_v1_3,
173DXILSubArch_v1_4,
174DXILSubArch_v1_5,
175DXILSubArch_v1_6,
176DXILSubArch_v1_7,
177DXILSubArch_v1_8,
178LatestDXILSubArch =DXILSubArch_v1_8,
179 };
180enumVendorType {
181UnknownVendor,
182
183Apple,
184PC,
185SCEI,
186Freescale,
187IBM,
188ImaginationTechnologies,
189MipsTechnologies,
190NVIDIA,
191CSR,
192AMD,
193Mesa,
194SUSE,
195OpenEmbedded,
196Intel,
197LastVendorType =Intel
198 };
199enumOSType {
200UnknownOS,
201
202Darwin,
203DragonFly,
204FreeBSD,
205Fuchsia,
206IOS,
207KFreeBSD,
208Linux,
209Lv2,// PS3
210MacOSX,
211NetBSD,
212OpenBSD,
213Solaris,
214UEFI,
215Win32,
216ZOS,
217Haiku,
218RTEMS,
219NaCl,// Native Client
220AIX,
221CUDA,// NVIDIA CUDA
222NVCL,// NVIDIA OpenCL
223AMDHSA,// AMD HSA Runtime
224PS4,
225PS5,
226ELFIAMCU,
227TvOS,// Apple tvOS
228WatchOS,// Apple watchOS
229BridgeOS,// Apple bridgeOS
230DriverKit,// Apple DriverKit
231XROS,// Apple XROS
232Mesa3D,
233AMDPAL,// AMD PAL Runtime
234HermitCore,// HermitCore Unikernel/Multikernel
235Hurd,// GNU/Hurd
236WASI,// Experimental WebAssembly OS
237Emscripten,
238ShaderModel,// DirectX ShaderModel
239LiteOS,
240Serenity,
241Vulkan,// Vulkan SPIR-V
242LastOSType =Vulkan
243 };
244enumEnvironmentType {
245UnknownEnvironment,
246
247GNU,
248GNUT64,
249GNUABIN32,
250GNUABI64,
251GNUEABI,
252GNUEABIT64,
253GNUEABIHF,
254GNUEABIHFT64,
255GNUF32,
256GNUF64,
257GNUSF,
258GNUX32,
259GNUILP32,
260CODE16,
261EABI,
262EABIHF,
263Android,
264Musl,
265MuslABIN32,
266MuslABI64,
267MuslEABI,
268MuslEABIHF,
269MuslF32,
270MuslSF,
271MuslX32,
272LLVM,
273
274MSVC,
275Itanium,
276Cygnus,
277CoreCLR,
278Simulator,// Simulator variants of other systems, e.g., Apple's iOS
279MacABI,// Mac Catalyst variant of Apple's iOS deployment target.
280
281// Shader Stages
282// The order of these values matters, and must be kept in sync with the
283// language options enum in Clang. The ordering is enforced in
284// static_asserts in Triple.cpp and in Clang.
285Pixel,
286Vertex,
287Geometry,
288Hull,
289Domain,
290Compute,
291Library,
292RayGeneration,
293Intersection,
294AnyHit,
295ClosestHit,
296Miss,
297Callable,
298Mesh,
299Amplification,
300OpenCL,
301OpenHOS,
302
303PAuthTest,
304
305LastEnvironmentType =PAuthTest
306 };
307enumObjectFormatType {
308UnknownObjectFormat,
309
310COFF,
311DXContainer,
312ELF,
313GOFF,
314MachO,
315SPIRV,
316Wasm,
317XCOFF,
318 };
319
320private:
321 std::string Data;
322
323 /// The parsed arch type.
324ArchType Arch{};
325
326 /// The parsed subarchitecture type.
327SubArchType SubArch{};
328
329 /// The parsed vendor type.
330VendorType Vendor{};
331
332 /// The parsed OS type.
333OSType OS{};
334
335 /// The parsed Environment type.
336EnvironmentType Environment{};
337
338 /// The object format type.
339ObjectFormatType ObjectFormat{};
340
341public:
342 /// @name Constructors
343 /// @{
344
345 /// Default constructor is the same as an empty string and leaves all
346 /// triple fields unknown.
347Triple() =default;
348
349explicitTriple(constTwine &Str);
350Triple(constTwine &ArchStr,constTwine &VendorStr,constTwine &OSStr);
351Triple(constTwine &ArchStr,constTwine &VendorStr,constTwine &OSStr,
352constTwine &EnvironmentStr);
353
354booloperator==(constTriple &Other) const{
355return Arch ==Other.Arch && SubArch ==Other.SubArch &&
356 Vendor ==Other.Vendor && OS ==Other.OS &&
357 Environment ==Other.Environment &&
358 ObjectFormat ==Other.ObjectFormat;
359 }
360
361booloperator!=(constTriple &Other) const{
362return !(*this ==Other);
363 }
364
365 /// @}
366 /// @name Normalization
367 /// @{
368
369 /// Canonical form
370enum classCanonicalForm {
371ANY = 0,
372THREE_IDENT = 3,// ARCHITECTURE-VENDOR-OPERATING_SYSTEM
373FOUR_IDENT = 4,// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
374FIVE_IDENT = 5,// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT-FORMAT
375 };
376
377 /// Turn an arbitrary machine specification into the canonical triple form (or
378 /// something sensible that the Triple class understands if nothing better can
379 /// reasonably be done). In particular, it handles the common case in which
380 /// otherwise valid components are in the wrong order. \p Form is used to
381 /// specify the output canonical form.
382static std::stringnormalize(StringRef Str,
383CanonicalForm Form =CanonicalForm::ANY);
384
385 /// Return the normalized form of this triple's string.
386 std::stringnormalize(CanonicalForm Form =CanonicalForm::ANY) const{
387returnnormalize(Data, Form);
388 }
389
390 /// @}
391 /// @name Typed Component Access
392 /// @{
393
394 /// Get the parsed architecture type of this triple.
395ArchTypegetArch() const{return Arch; }
396
397 /// get the parsed subarchitecture type for this triple.
398SubArchTypegetSubArch() const{return SubArch; }
399
400 /// Get the parsed vendor type of this triple.
401VendorTypegetVendor() const{return Vendor; }
402
403 /// Get the parsed operating system type of this triple.
404OSTypegetOS() const{return OS; }
405
406 /// Does this triple have the optional environment (fourth) component?
407boolhasEnvironment() const{
408returngetEnvironmentName() !="";
409 }
410
411 /// Get the parsed environment type of this triple.
412EnvironmentTypegetEnvironment() const{return Environment; }
413
414 /// Parse the version number from the OS name component of the
415 /// triple, if present.
416 ///
417 /// For example, "fooos1.2.3" would return (1, 2, 3).
418VersionTuplegetEnvironmentVersion()const;
419
420 /// Get the object format for this triple.
421ObjectFormatTypegetObjectFormat() const{return ObjectFormat; }
422
423 /// Parse the version number from the OS name component of the triple, if
424 /// present.
425 ///
426 /// For example, "fooos1.2.3" would return (1, 2, 3).
427VersionTuplegetOSVersion()const;
428
429 /// Return just the major version number, this is specialized because it is a
430 /// common query.
431unsignedgetOSMajorVersion() const{returngetOSVersion().getMajor(); }
432
433 /// Parse the version number as with getOSVersion and then translate generic
434 /// "darwin" versions to the corresponding OS X versions. This may also be
435 /// called with IOS triples but the OS X version number is just set to a
436 /// constant 10.4.0 in that case. Returns true if successful.
437boolgetMacOSXVersion(VersionTuple &Version)const;
438
439 /// Parse the version number as with getOSVersion. This should only be called
440 /// with IOS or generic triples.
441VersionTuplegetiOSVersion()const;
442
443 /// Parse the version number as with getOSVersion. This should only be called
444 /// with WatchOS or generic triples.
445VersionTuplegetWatchOSVersion()const;
446
447 /// Parse the version number as with getOSVersion.
448VersionTuplegetDriverKitVersion()const;
449
450 /// Parse the Vulkan version number from the OSVersion and SPIR-V version
451 /// (SubArch). This should only be called with Vulkan SPIR-V triples.
452VersionTuplegetVulkanVersion()const;
453
454 /// Parse the DXIL version number from the OSVersion and DXIL version
455 /// (SubArch). This should only be called with DXIL triples.
456VersionTuplegetDXILVersion()const;
457
458 /// @}
459 /// @name Direct Component Access
460 /// @{
461
462const std::string &str() const{return Data; }
463
464const std::string &getTriple() const{return Data; }
465
466 /// Get the architecture (first) component of the triple.
467StringRefgetArchName()const;
468
469 /// Get the vendor (second) component of the triple.
470StringRefgetVendorName()const;
471
472 /// Get the operating system (third) component of the triple.
473StringRefgetOSName()const;
474
475 /// Get the optional environment (fourth) component of the triple, or "" if
476 /// empty.
477StringRefgetEnvironmentName()const;
478
479 /// Get the operating system and optional environment components as a single
480 /// string (separated by a '-' if the environment component is present).
481StringRefgetOSAndEnvironmentName()const;
482
483 /// Get the version component of the environment component as a single
484 /// string (the version after the environment).
485 ///
486 /// For example, "fooos1.2.3" would return "1.2.3".
487StringRefgetEnvironmentVersionString()const;
488
489 /// @}
490 /// @name Convenience Predicates
491 /// @{
492
493 /// Returns the pointer width of this architecture.
494staticunsignedgetArchPointerBitWidth(llvm::Triple::ArchType Arch);
495
496 /// Returns the pointer width of this architecture.
497unsignedgetArchPointerBitWidth() const{
498returngetArchPointerBitWidth(getArch());
499 }
500
501 /// Returns the trampoline size in bytes for this configuration.
502unsignedgetTrampolineSize()const;
503
504 /// Test whether the architecture is 64-bit
505 ///
506 /// Note that this tests for 64-bit pointer width, and nothing else. Note
507 /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
508 /// 16-bit. The inner details of pointer width for particular architectures
509 /// is not summed up in the triple, and so only a coarse grained predicate
510 /// system is provided.
511boolisArch64Bit()const;
512
513 /// Test whether the architecture is 32-bit
514 ///
515 /// Note that this tests for 32-bit pointer width, and nothing else.
516boolisArch32Bit()const;
517
518 /// Test whether the architecture is 16-bit
519 ///
520 /// Note that this tests for 16-bit pointer width, and nothing else.
521boolisArch16Bit()const;
522
523 /// Helper function for doing comparisons against version numbers included in
524 /// the target triple.
525boolisOSVersionLT(unsigned Major,unsigned Minor = 0,
526unsigned Micro = 0) const{
527if (Minor == 0) {
528returngetOSVersion() <VersionTuple(Major);
529 }
530if (Micro == 0) {
531returngetOSVersion() <VersionTuple(Major, Minor);
532 }
533returngetOSVersion() <VersionTuple(Major, Minor, Micro);
534 }
535
536boolisOSVersionLT(constTriple &Other) const{
537returngetOSVersion() <Other.getOSVersion();
538 }
539
540 /// Comparison function for checking OS X version compatibility, which handles
541 /// supporting skewed version numbering schemes used by the "darwin" triples.
542boolisMacOSXVersionLT(unsigned Major,unsigned Minor = 0,
543unsigned Micro = 0)const;
544
545 /// Is this a Mac OS X triple. For legacy reasons, we support both "darwin"
546 /// and "osx" as OS X triples.
547boolisMacOSX() const{
548returngetOS() ==Triple::Darwin ||getOS() ==Triple::MacOSX;
549 }
550
551 /// Is this an iOS triple.
552 /// Note: This identifies tvOS as a variant of iOS. If that ever
553 /// changes, i.e., if the two operating systems diverge or their version
554 /// numbers get out of sync, that will need to be changed.
555 /// watchOS has completely different version numbers so it is not included.
556boolisiOS() const{
557returngetOS() ==Triple::IOS ||isTvOS();
558 }
559
560 /// Is this an Apple tvOS triple.
561boolisTvOS() const{
562returngetOS() ==Triple::TvOS;
563 }
564
565 /// Is this an Apple watchOS triple.
566boolisWatchOS() const{
567returngetOS() ==Triple::WatchOS;
568 }
569
570boolisWatchABI() const{
571returngetSubArch() ==Triple::ARMSubArch_v7k;
572 }
573
574 /// Is this an Apple XROS triple.
575boolisXROS() const{returngetOS() ==Triple::XROS; }
576
577 /// Is this an Apple DriverKit triple.
578boolisDriverKit() const{returngetOS() ==Triple::DriverKit; }
579
580boolisOSzOS() const{returngetOS() ==Triple::ZOS; }
581
582 /// Is this an Apple MachO triple.
583boolisAppleMachO() const{
584return (getVendor() ==Triple::Apple) &&isOSBinFormatMachO();
585 }
586
587 /// Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, XROS, or DriverKit).
588boolisOSDarwin() const{
589returnisMacOSX() ||isiOS() ||isWatchOS() ||isDriverKit() ||isXROS();
590 }
591
592boolisSimulatorEnvironment() const{
593returngetEnvironment() ==Triple::Simulator;
594 }
595
596boolisMacCatalystEnvironment() const{
597returngetEnvironment() ==Triple::MacABI;
598 }
599
600 /// Returns true for targets that run on a macOS machine.
601boolisTargetMachineMac() const{
602returnisMacOSX() || (isOSDarwin() && (isSimulatorEnvironment() ||
603isMacCatalystEnvironment()));
604 }
605
606boolisOSNetBSD() const{
607returngetOS() ==Triple::NetBSD;
608 }
609
610boolisOSOpenBSD() const{
611returngetOS() ==Triple::OpenBSD;
612 }
613
614boolisOSFreeBSD() const{
615returngetOS() ==Triple::FreeBSD;
616 }
617
618boolisOSFuchsia() const{
619returngetOS() ==Triple::Fuchsia;
620 }
621
622boolisOSDragonFly() const{returngetOS() ==Triple::DragonFly; }
623
624boolisOSSolaris() const{
625returngetOS() ==Triple::Solaris;
626 }
627
628boolisOSIAMCU() const{
629returngetOS() ==Triple::ELFIAMCU;
630 }
631
632boolisOSUnknown() const{returngetOS() ==Triple::UnknownOS; }
633
634boolisGNUEnvironment() const{
635EnvironmentType Env =getEnvironment();
636return Env ==Triple::GNU || Env ==Triple::GNUT64 ||
637 Env ==Triple::GNUABIN32 || Env ==Triple::GNUABI64 ||
638 Env ==Triple::GNUEABI || Env ==Triple::GNUEABIT64 ||
639 Env ==Triple::GNUEABIHF || Env ==Triple::GNUEABIHFT64 ||
640 Env ==Triple::GNUF32 || Env ==Triple::GNUF64 ||
641 Env ==Triple::GNUSF || Env ==Triple::GNUX32;
642 }
643
644 /// Tests whether the OS is Haiku.
645boolisOSHaiku() const{
646returngetOS() ==Triple::Haiku;
647 }
648
649 /// Tests whether the OS is UEFI.
650boolisUEFI() const{
651returngetOS() ==Triple::UEFI;
652 }
653
654 /// Tests whether the OS is Windows.
655boolisOSWindows() const{
656returngetOS() ==Triple::Win32;
657 }
658
659 /// Checks if the environment is MSVC.
660boolisKnownWindowsMSVCEnvironment() const{
661returnisOSWindows() &&getEnvironment() ==Triple::MSVC;
662 }
663
664 /// Checks if the environment could be MSVC.
665boolisWindowsMSVCEnvironment() const{
666returnisKnownWindowsMSVCEnvironment() ||
667 (isOSWindows() &&getEnvironment() ==Triple::UnknownEnvironment);
668 }
669
670// Checks if we're using the Windows Arm64EC ABI.
671boolisWindowsArm64EC() const{
672returngetArch() ==Triple::aarch64 &&
673getSubArch() ==Triple::AArch64SubArch_arm64ec;
674 }
675
676boolisWindowsCoreCLREnvironment() const{
677returnisOSWindows() &&getEnvironment() ==Triple::CoreCLR;
678 }
679
680boolisWindowsItaniumEnvironment() const{
681returnisOSWindows() &&getEnvironment() ==Triple::Itanium;
682 }
683
684boolisWindowsCygwinEnvironment() const{
685returnisOSWindows() &&getEnvironment() ==Triple::Cygnus;
686 }
687
688boolisWindowsGNUEnvironment() const{
689returnisOSWindows() &&getEnvironment() ==Triple::GNU;
690 }
691
692 /// Tests for either Cygwin or MinGW OS
693boolisOSCygMing() const{
694returnisWindowsCygwinEnvironment() ||isWindowsGNUEnvironment();
695 }
696
697 /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
698boolisOSMSVCRT() const{
699returnisWindowsMSVCEnvironment() ||isWindowsGNUEnvironment() ||
700isWindowsItaniumEnvironment();
701 }
702
703 /// Tests whether the OS is NaCl (Native Client)
704boolisOSNaCl() const{
705returngetOS() ==Triple::NaCl;
706 }
707
708 /// Tests whether the OS is Linux.
709boolisOSLinux() const{
710returngetOS() ==Triple::Linux;
711 }
712
713 /// Tests whether the OS is kFreeBSD.
714boolisOSKFreeBSD() const{
715returngetOS() ==Triple::KFreeBSD;
716 }
717
718 /// Tests whether the OS is Hurd.
719boolisOSHurd() const{
720returngetOS() ==Triple::Hurd;
721 }
722
723 /// Tests whether the OS is WASI.
724boolisOSWASI() const{
725returngetOS() ==Triple::WASI;
726 }
727
728 /// Tests whether the OS is Emscripten.
729boolisOSEmscripten() const{
730returngetOS() ==Triple::Emscripten;
731 }
732
733 /// Tests whether the OS uses glibc.
734boolisOSGlibc() const{
735return (getOS() ==Triple::Linux ||getOS() ==Triple::KFreeBSD ||
736getOS() ==Triple::Hurd) &&
737 !isAndroid();
738 }
739
740 /// Tests whether the OS is AIX.
741boolisOSAIX() const{
742returngetOS() ==Triple::AIX;
743 }
744
745boolisOSSerenity() const{
746returngetOS() ==Triple::Serenity;
747 }
748
749 /// Tests whether the OS uses the ELF binary format.
750boolisOSBinFormatELF() const{
751returngetObjectFormat() ==Triple::ELF;
752 }
753
754 /// Tests whether the OS uses the COFF binary format.
755boolisOSBinFormatCOFF() const{
756returngetObjectFormat() ==Triple::COFF;
757 }
758
759 /// Tests whether the OS uses the GOFF binary format.
760boolisOSBinFormatGOFF() const{returngetObjectFormat() ==Triple::GOFF; }
761
762 /// Tests whether the environment is MachO.
763boolisOSBinFormatMachO() const{
764returngetObjectFormat() ==Triple::MachO;
765 }
766
767 /// Tests whether the OS uses the Wasm binary format.
768boolisOSBinFormatWasm() const{
769returngetObjectFormat() ==Triple::Wasm;
770 }
771
772 /// Tests whether the OS uses the XCOFF binary format.
773boolisOSBinFormatXCOFF() const{
774returngetObjectFormat() ==Triple::XCOFF;
775 }
776
777 /// Tests whether the OS uses the DXContainer binary format.
778boolisOSBinFormatDXContainer() const{
779returngetObjectFormat() ==Triple::DXContainer;
780 }
781
782 /// Tests whether the target is the PS4 platform.
783boolisPS4() const{
784returngetArch() ==Triple::x86_64 &&
785getVendor() ==Triple::SCEI &&
786getOS() ==Triple::PS4;
787 }
788
789 /// Tests whether the target is the PS5 platform.
790boolisPS5() const{
791returngetArch() ==Triple::x86_64 &&
792getVendor() ==Triple::SCEI &&
793getOS() ==Triple::PS5;
794 }
795
796 /// Tests whether the target is the PS4 or PS5 platform.
797boolisPS() const{returnisPS4() ||isPS5(); }
798
799 /// Tests whether the target is Android
800boolisAndroid() const{returngetEnvironment() ==Triple::Android; }
801
802boolisAndroidVersionLT(unsigned Major) const{
803assert(isAndroid() &&"Not an Android triple!");
804
805VersionTupleVersion =getEnvironmentVersion();
806
807// 64-bit targets did not exist before API level 21 (Lollipop).
808if (isArch64Bit() &&Version.getMajor() < 21)
809returnVersionTuple(21) <VersionTuple(Major);
810
811returnVersion <VersionTuple(Major);
812 }
813
814 /// Tests whether the environment is musl-libc
815boolisMusl() const{
816returngetEnvironment() ==Triple::Musl ||
817getEnvironment() ==Triple::MuslABIN32 ||
818getEnvironment() ==Triple::MuslABI64 ||
819getEnvironment() ==Triple::MuslEABI ||
820getEnvironment() ==Triple::MuslEABIHF ||
821getEnvironment() ==Triple::MuslF32 ||
822getEnvironment() ==Triple::MuslSF ||
823getEnvironment() ==Triple::MuslX32 ||
824getEnvironment() ==Triple::OpenHOS ||isOSLiteOS();
825 }
826
827 /// Tests whether the target is OHOS
828 /// LiteOS default enviroment is also OHOS, but omited on triple.
829boolisOHOSFamily() const{returnisOpenHOS() ||isOSLiteOS(); }
830
831boolisOpenHOS() const{returngetEnvironment() ==Triple::OpenHOS; }
832
833boolisOSLiteOS() const{returngetOS() ==Triple::LiteOS; }
834
835 /// Tests whether the target is DXIL.
836boolisDXIL() const{
837returngetArch() ==Triple::dxil;
838 }
839
840boolisShaderModelOS() const{
841returngetOS() ==Triple::ShaderModel;
842 }
843
844boolisVulkanOS() const{returngetOS() ==Triple::Vulkan; }
845
846boolisShaderStageEnvironment() const{
847EnvironmentType Env =getEnvironment();
848return Env ==Triple::Pixel || Env ==Triple::Vertex ||
849 Env ==Triple::Geometry || Env ==Triple::Hull ||
850 Env ==Triple::Domain || Env ==Triple::Compute ||
851 Env ==Triple::Library || Env ==Triple::RayGeneration ||
852 Env ==Triple::Intersection || Env ==Triple::AnyHit ||
853 Env ==Triple::ClosestHit || Env ==Triple::Miss ||
854 Env ==Triple::Callable || Env ==Triple::Mesh ||
855 Env ==Triple::Amplification;
856 }
857
858 /// Tests whether the target is SPIR (32- or 64-bit).
859boolisSPIR() const{
860returngetArch() ==Triple::spir ||getArch() ==Triple::spir64;
861 }
862
863 /// Tests whether the target is SPIR-V (32/64-bit/Logical).
864boolisSPIRV() const{
865returngetArch() ==Triple::spirv32 ||getArch() ==Triple::spirv64 ||
866getArch() ==Triple::spirv;
867 }
868
869// Tests whether the target is SPIR-V or SPIR.
870boolisSPIROrSPIRV() const{returnisSPIR() ||isSPIRV(); }
871
872 /// Tests whether the target is SPIR-V Logical
873boolisSPIRVLogical() const{
874returngetArch() ==Triple::spirv;
875 }
876
877 /// Tests whether the target is NVPTX (32- or 64-bit).
878boolisNVPTX() const{
879returngetArch() ==Triple::nvptx ||getArch() ==Triple::nvptx64;
880 }
881
882 /// Tests whether the target is AMDGCN
883boolisAMDGCN() const{returngetArch() ==Triple::amdgcn; }
884
885boolisAMDGPU() const{
886returngetArch() ==Triple::r600 ||getArch() ==Triple::amdgcn;
887 }
888
889 /// Tests whether the target is Thumb (little and big endian).
890boolisThumb() const{
891returngetArch() ==Triple::thumb ||getArch() ==Triple::thumbeb;
892 }
893
894 /// Tests whether the target is ARM (little and big endian).
895boolisARM() const{
896returngetArch() ==Triple::arm ||getArch() ==Triple::armeb;
897 }
898
899 /// Tests whether the target supports the EHABI exception
900 /// handling standard.
901boolisTargetEHABICompatible() const{
902return (isARM() ||isThumb()) &&
903 (getEnvironment() ==Triple::EABI ||
904getEnvironment() ==Triple::GNUEABI ||
905getEnvironment() ==Triple::GNUEABIT64 ||
906getEnvironment() ==Triple::MuslEABI ||
907getEnvironment() ==Triple::EABIHF ||
908getEnvironment() ==Triple::GNUEABIHF ||
909getEnvironment() ==Triple::GNUEABIHFT64 ||
910getEnvironment() ==Triple::OpenHOS ||
911getEnvironment() ==Triple::MuslEABIHF ||isAndroid()) &&
912isOSBinFormatELF();
913 }
914
915 /// Tests whether the target is T32.
916boolisArmT32() const{
917switch (getSubArch()) {
918caseTriple::ARMSubArch_v8m_baseline:
919caseTriple::ARMSubArch_v7s:
920caseTriple::ARMSubArch_v7k:
921caseTriple::ARMSubArch_v7ve:
922caseTriple::ARMSubArch_v6:
923caseTriple::ARMSubArch_v6m:
924caseTriple::ARMSubArch_v6k:
925caseTriple::ARMSubArch_v6t2:
926caseTriple::ARMSubArch_v5:
927caseTriple::ARMSubArch_v5te:
928caseTriple::ARMSubArch_v4t:
929returnfalse;
930default:
931returntrue;
932 }
933 }
934
935 /// Tests whether the target is an M-class.
936boolisArmMClass() const{
937switch (getSubArch()) {
938caseTriple::ARMSubArch_v6m:
939caseTriple::ARMSubArch_v7m:
940caseTriple::ARMSubArch_v7em:
941caseTriple::ARMSubArch_v8m_mainline:
942caseTriple::ARMSubArch_v8m_baseline:
943caseTriple::ARMSubArch_v8_1m_mainline:
944returntrue;
945default:
946returnfalse;
947 }
948 }
949
950 /// Tests whether the target is AArch64 (little and big endian).
951boolisAArch64() const{
952returngetArch() ==Triple::aarch64 ||getArch() ==Triple::aarch64_be ||
953getArch() ==Triple::aarch64_32;
954 }
955
956 /// Tests whether the target is AArch64 and pointers are the size specified by
957 /// \p PointerWidth.
958boolisAArch64(int PointerWidth) const{
959assert(PointerWidth == 64 || PointerWidth == 32);
960if (!isAArch64())
961returnfalse;
962returngetArch() ==Triple::aarch64_32 ||
963getEnvironment() ==Triple::GNUILP32
964 ? PointerWidth == 32
965 : PointerWidth == 64;
966 }
967
968 /// Tests whether the target is 32-bit LoongArch.
969boolisLoongArch32() const{returngetArch() ==Triple::loongarch32; }
970
971 /// Tests whether the target is 64-bit LoongArch.
972boolisLoongArch64() const{returngetArch() ==Triple::loongarch64; }
973
974 /// Tests whether the target is LoongArch (32- and 64-bit).
975boolisLoongArch() const{returnisLoongArch32() ||isLoongArch64(); }
976
977 /// Tests whether the target is MIPS 32-bit (little and big endian).
978boolisMIPS32() const{
979returngetArch() ==Triple::mips ||getArch() ==Triple::mipsel;
980 }
981
982 /// Tests whether the target is MIPS 64-bit (little and big endian).
983boolisMIPS64() const{
984returngetArch() ==Triple::mips64 ||getArch() ==Triple::mips64el;
985 }
986
987 /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
988boolisMIPS() const{
989returnisMIPS32() ||isMIPS64();
990 }
991
992 /// Tests whether the target is PowerPC (32- or 64-bit LE or BE).
993boolisPPC() const{
994returngetArch() ==Triple::ppc ||getArch() ==Triple::ppc64 ||
995getArch() ==Triple::ppcle ||getArch() ==Triple::ppc64le;
996 }
997
998 /// Tests whether the target is 32-bit PowerPC (little and big endian).
999boolisPPC32() const{
1000returngetArch() ==Triple::ppc ||getArch() ==Triple::ppcle;
1001 }
1002
1003 /// Tests whether the target is 64-bit PowerPC (little and big endian).
1004boolisPPC64() const{
1005returngetArch() ==Triple::ppc64 ||getArch() ==Triple::ppc64le;
1006 }
1007
1008 /// Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
1009boolisPPC64ELFv2ABI() const{
1010return (getArch() ==Triple::ppc64 &&
1011 ((getOS() ==Triple::FreeBSD &&
1012 (getOSMajorVersion() >= 13 ||getOSVersion().empty())) ||
1013getOS() ==Triple::OpenBSD ||isMusl()));
1014 }
1015
1016 /// Tests whether the target 32-bit PowerPC uses Secure PLT.
1017boolisPPC32SecurePlt() const{
1018return ((getArch() ==Triple::ppc ||getArch() ==Triple::ppcle) &&
1019 ((getOS() ==Triple::FreeBSD &&
1020 (getOSMajorVersion() >= 13 ||getOSVersion().empty())) ||
1021getOS() ==Triple::NetBSD ||getOS() ==Triple::OpenBSD ||
1022isMusl()));
1023 }
1024
1025 /// Tests whether the target is 32-bit RISC-V.
1026boolisRISCV32() const{returngetArch() ==Triple::riscv32; }
1027
1028 /// Tests whether the target is 64-bit RISC-V.
1029boolisRISCV64() const{returngetArch() ==Triple::riscv64; }
1030
1031 /// Tests whether the target is RISC-V (32- and 64-bit).
1032boolisRISCV() const{returnisRISCV32() ||isRISCV64(); }
1033
1034 /// Tests whether the target is 32-bit SPARC (little and big endian).
1035boolisSPARC32() const{
1036returngetArch() ==Triple::sparc ||getArch() ==Triple::sparcel;
1037 }
1038
1039 /// Tests whether the target is 64-bit SPARC (big endian).
1040boolisSPARC64() const{returngetArch() ==Triple::sparcv9; }
1041
1042 /// Tests whether the target is SPARC.
1043boolisSPARC() const{returnisSPARC32() ||isSPARC64(); }
1044
1045 /// Tests whether the target is SystemZ.
1046boolisSystemZ() const{
1047returngetArch() ==Triple::systemz;
1048 }
1049
1050 /// Tests whether the target is x86 (32- or 64-bit).
1051boolisX86() const{
1052returngetArch() ==Triple::x86 ||getArch() ==Triple::x86_64;
1053 }
1054
1055 /// Tests whether the target is VE
1056boolisVE() const{
1057returngetArch() ==Triple::ve;
1058 }
1059
1060 /// Tests whether the target is wasm (32- and 64-bit).
1061boolisWasm() const{
1062returngetArch() ==Triple::wasm32 ||getArch() ==Triple::wasm64;
1063 }
1064
1065// Tests whether the target is CSKY
1066boolisCSKY() const{
1067returngetArch() ==Triple::csky;
1068 }
1069
1070 /// Tests whether the target is the Apple "arm64e" AArch64 subarch.
1071boolisArm64e() const{
1072returngetArch() ==Triple::aarch64 &&
1073getSubArch() ==Triple::AArch64SubArch_arm64e;
1074 }
1075
1076// Tests whether the target is N32.
1077boolisABIN32() const{
1078EnvironmentType Env =getEnvironment();
1079return Env ==Triple::GNUABIN32 || Env ==Triple::MuslABIN32;
1080 }
1081
1082 /// Tests whether the target is X32.
1083boolisX32() const{
1084EnvironmentType Env =getEnvironment();
1085return Env ==Triple::GNUX32 || Env ==Triple::MuslX32;
1086 }
1087
1088 /// Tests whether the target is eBPF.
1089boolisBPF() const{
1090returngetArch() ==Triple::bpfel ||getArch() ==Triple::bpfeb;
1091 }
1092
1093 /// Tests if the target forces 64-bit time_t on a 32-bit architecture.
1094boolisTime64ABI() const{
1095EnvironmentType Env =getEnvironment();
1096return Env ==Triple::GNUT64 || Env ==Triple::GNUEABIT64 ||
1097 Env ==Triple::GNUEABIHFT64;
1098 }
1099
1100 /// Tests if the target forces hardfloat.
1101boolisHardFloatABI() const{
1102EnvironmentType Env =getEnvironment();
1103return Env ==llvm::Triple::GNUEABIHF ||
1104 Env ==llvm::Triple::GNUEABIHFT64 ||
1105 Env ==llvm::Triple::MuslEABIHF ||
1106 Env ==llvm::Triple::EABIHF;
1107 }
1108
1109 /// Tests whether the target supports comdat
1110boolsupportsCOMDAT() const{
1111return !(isOSBinFormatMachO() ||isOSBinFormatXCOFF() ||
1112isOSBinFormatDXContainer());
1113 }
1114
1115 /// Tests whether the target uses emulated TLS as default.
1116 ///
1117 /// Note: Android API level 29 (10) introduced ELF TLS.
1118boolhasDefaultEmulatedTLS() const{
1119return (isAndroid() &&isAndroidVersionLT(29)) ||isOSOpenBSD() ||
1120isWindowsCygwinEnvironment() ||isOHOSFamily();
1121 }
1122
1123 /// True if the target supports both general-dynamic and TLSDESC, and TLSDESC
1124 /// is enabled by default.
1125boolhasDefaultTLSDESC() const{returnisAndroid() &&isRISCV64(); }
1126
1127 /// Tests whether the target uses -data-sections as default.
1128boolhasDefaultDataSections() const{
1129returnisOSBinFormatXCOFF() ||isWasm();
1130 }
1131
1132 /// Tests if the environment supports dllimport/export annotations.
1133boolhasDLLImportExport() const{returnisOSWindows() ||isPS(); }
1134
1135 /// @}
1136 /// @name Mutators
1137 /// @{
1138
1139 /// Set the architecture (first) component of the triple to a known type.
1140voidsetArch(ArchType Kind,SubArchType SubArch =NoSubArch);
1141
1142 /// Set the vendor (second) component of the triple to a known type.
1143voidsetVendor(VendorType Kind);
1144
1145 /// Set the operating system (third) component of the triple to a known type.
1146voidsetOS(OSType Kind);
1147
1148 /// Set the environment (fourth) component of the triple to a known type.
1149voidsetEnvironment(EnvironmentType Kind);
1150
1151 /// Set the object file format.
1152voidsetObjectFormat(ObjectFormatType Kind);
1153
1154 /// Set all components to the new triple \p Str.
1155voidsetTriple(constTwine &Str);
1156
1157 /// Set the architecture (first) component of the triple by name.
1158voidsetArchName(StringRef Str);
1159
1160 /// Set the vendor (second) component of the triple by name.
1161voidsetVendorName(StringRef Str);
1162
1163 /// Set the operating system (third) component of the triple by name.
1164voidsetOSName(StringRef Str);
1165
1166 /// Set the optional environment (fourth) component of the triple by name.
1167voidsetEnvironmentName(StringRef Str);
1168
1169 /// Set the operating system and optional environment components with a single
1170 /// string.
1171voidsetOSAndEnvironmentName(StringRef Str);
1172
1173 /// @}
1174 /// @name Helpers to build variants of a particular triple.
1175 /// @{
1176
1177 /// Form a triple with a 32-bit variant of the current architecture.
1178 ///
1179 /// This can be used to move across "families" of architectures where useful.
1180 ///
1181 /// \returns A new triple with a 32-bit architecture or an unknown
1182 /// architecture if no such variant can be found.
1183llvm::Tripleget32BitArchVariant()const;
1184
1185 /// Form a triple with a 64-bit variant of the current architecture.
1186 ///
1187 /// This can be used to move across "families" of architectures where useful.
1188 ///
1189 /// \returns A new triple with a 64-bit architecture or an unknown
1190 /// architecture if no such variant can be found.
1191llvm::Tripleget64BitArchVariant()const;
1192
1193 /// Form a triple with a big endian variant of the current architecture.
1194 ///
1195 /// This can be used to move across "families" of architectures where useful.
1196 ///
1197 /// \returns A new triple with a big endian architecture or an unknown
1198 /// architecture if no such variant can be found.
1199llvm::TriplegetBigEndianArchVariant()const;
1200
1201 /// Form a triple with a little endian variant of the current architecture.
1202 ///
1203 /// This can be used to move across "families" of architectures where useful.
1204 ///
1205 /// \returns A new triple with a little endian architecture or an unknown
1206 /// architecture if no such variant can be found.
1207llvm::TriplegetLittleEndianArchVariant()const;
1208
1209 /// Tests whether the target triple is little endian.
1210 ///
1211 /// \returns true if the triple is little endian, false otherwise.
1212boolisLittleEndian()const;
1213
1214 /// Test whether target triples are compatible.
1215boolisCompatibleWith(constTriple &Other)const;
1216
1217 /// Merge target triples.
1218 std::stringmerge(constTriple &Other)const;
1219
1220 /// Some platforms have different minimum supported OS versions that
1221 /// varies by the architecture specified in the triple. This function
1222 /// returns the minimum supported OS version for this triple if one an exists,
1223 /// or an invalid version tuple if this triple doesn't have one.
1224VersionTuplegetMinimumSupportedOSVersion()const;
1225
1226 /// @}
1227 /// @name Static helpers for IDs.
1228 /// @{
1229
1230 /// Get the canonical name for the \p Kind architecture.
1231staticStringRefgetArchTypeName(ArchType Kind);
1232
1233 /// Get the architecture name based on \p Kind and \p SubArch.
1234staticStringRefgetArchName(ArchType Kind,SubArchType SubArch =NoSubArch);
1235
1236 /// Get the "prefix" canonical name for the \p Kind architecture. This is the
1237 /// prefix used by the architecture specific builtins, and is suitable for
1238 /// passing to \see Intrinsic::getIntrinsicForClangBuiltin().
1239 ///
1240 /// \return - The architecture prefix, or 0 if none is defined.
1241staticStringRefgetArchTypePrefix(ArchType Kind);
1242
1243 /// Get the canonical name for the \p Kind vendor.
1244staticStringRefgetVendorTypeName(VendorType Kind);
1245
1246 /// Get the canonical name for the \p Kind operating system.
1247staticStringRefgetOSTypeName(OSType Kind);
1248
1249 /// Get the canonical name for the \p Kind environment.
1250staticStringRefgetEnvironmentTypeName(EnvironmentType Kind);
1251
1252 /// Get the name for the \p Object format.
1253staticStringRefgetObjectFormatTypeName(ObjectFormatType ObjectFormat);
1254
1255 /// @}
1256 /// @name Static helpers for converting alternate architecture names.
1257 /// @{
1258
1259 /// The canonical type for the given LLVM architecture name (e.g., "x86").
1260staticArchTypegetArchTypeForLLVMName(StringRef Str);
1261
1262 /// @}
1263
1264 /// Returns a canonicalized OS version number for the specified OS.
1265staticVersionTuplegetCanonicalVersionForOS(OSType OSKind,
1266constVersionTuple &Version);
1267};
1268
1269}// End llvm namespace
1270
1271
1272#endif
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Twine.h
VersionTuple.h
Defines the llvm::VersionTuple class, which represents a version in the form major[....
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition:Triple.h:44
llvm::Triple::isMacOSXVersionLT
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:2103
llvm::Triple::getOSVersion
VersionTuple getOSVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition:Triple.cpp:1413
llvm::Triple::isPPC
bool isPPC() const
Tests whether the target is PowerPC (32- or 64-bit LE or BE).
Definition:Triple.h:993
llvm::Triple::isOSDragonFly
bool isOSDragonFly() const
Definition:Triple.h:622
llvm::Triple::getVendorName
StringRef getVendorName() const
Get the vendor (second) component of the triple.
Definition:Triple.cpp:1358
llvm::Triple::getWatchOSVersion
VersionTuple getWatchOSVersion() const
Parse the version number as with getOSVersion.
Definition:Triple.cpp:1502
llvm::Triple::setArchName
void setArchName(StringRef Str)
Set the architecture (first) component of the triple by name.
Definition:Triple.cpp:1609
llvm::Triple::isTargetMachineMac
bool isTargetMachineMac() const
Returns true for targets that run on a macOS machine.
Definition:Triple.h:601
llvm::Triple::isArmT32
bool isArmT32() const
Tests whether the target is T32.
Definition:Triple.h:916
llvm::Triple::isOSNaCl
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
Definition:Triple.h:704
llvm::Triple::setObjectFormat
void setObjectFormat(ObjectFormatType Kind)
Set the object file format.
Definition:Triple.cpp:1601
llvm::Triple::isAndroidVersionLT
bool isAndroidVersionLT(unsigned Major) const
Definition:Triple.h:802
llvm::Triple::get32BitArchVariant
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Definition:Triple.cpp:1746
llvm::Triple::isOSCygMing
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Definition:Triple.h:693
llvm::Triple::isWatchABI
bool isWatchABI() const
Definition:Triple.h:570
llvm::Triple::Triple
Triple()=default
Default constructor is the same as an empty string and leaves all triple fields unknown.
llvm::Triple::EnvironmentType
EnvironmentType
Definition:Triple.h:244
llvm::Triple::Cygnus
@ Cygnus
Definition:Triple.h:276
llvm::Triple::MuslABIN32
@ MuslABIN32
Definition:Triple.h:265
llvm::Triple::GNUILP32
@ GNUILP32
Definition:Triple.h:259
llvm::Triple::MacABI
@ MacABI
Definition:Triple.h:279
llvm::Triple::Android
@ Android
Definition:Triple.h:263
llvm::Triple::RayGeneration
@ RayGeneration
Definition:Triple.h:292
llvm::Triple::GNUABI64
@ GNUABI64
Definition:Triple.h:250
llvm::Triple::GNUEABIT64
@ GNUEABIT64
Definition:Triple.h:252
llvm::Triple::MuslABI64
@ MuslABI64
Definition:Triple.h:266
llvm::Triple::Musl
@ Musl
Definition:Triple.h:264
llvm::Triple::Compute
@ Compute
Definition:Triple.h:290
llvm::Triple::Library
@ Library
Definition:Triple.h:291
llvm::Triple::LastEnvironmentType
@ LastEnvironmentType
Definition:Triple.h:305
llvm::Triple::LLVM
@ LLVM
Definition:Triple.h:272
llvm::Triple::Pixel
@ Pixel
Definition:Triple.h:285
llvm::Triple::OpenHOS
@ OpenHOS
Definition:Triple.h:301
llvm::Triple::Simulator
@ Simulator
Definition:Triple.h:278
llvm::Triple::GNUF64
@ GNUF64
Definition:Triple.h:256
llvm::Triple::GNUF32
@ GNUF32
Definition:Triple.h:255
llvm::Triple::GNUT64
@ GNUT64
Definition:Triple.h:248
llvm::Triple::MuslF32
@ MuslF32
Definition:Triple.h:269
llvm::Triple::GNUEABIHF
@ GNUEABIHF
Definition:Triple.h:253
llvm::Triple::UnknownEnvironment
@ UnknownEnvironment
Definition:Triple.h:245
llvm::Triple::MSVC
@ MSVC
Definition:Triple.h:274
llvm::Triple::Vertex
@ Vertex
Definition:Triple.h:286
llvm::Triple::GNUEABI
@ GNUEABI
Definition:Triple.h:251
llvm::Triple::PAuthTest
@ PAuthTest
Definition:Triple.h:303
llvm::Triple::GNUABIN32
@ GNUABIN32
Definition:Triple.h:249
llvm::Triple::ClosestHit
@ ClosestHit
Definition:Triple.h:295
llvm::Triple::EABI
@ EABI
Definition:Triple.h:261
llvm::Triple::OpenCL
@ OpenCL
Definition:Triple.h:300
llvm::Triple::MuslEABI
@ MuslEABI
Definition:Triple.h:267
llvm::Triple::Domain
@ Domain
Definition:Triple.h:289
llvm::Triple::GNUSF
@ GNUSF
Definition:Triple.h:257
llvm::Triple::Mesh
@ Mesh
Definition:Triple.h:298
llvm::Triple::Itanium
@ Itanium
Definition:Triple.h:275
llvm::Triple::GNUX32
@ GNUX32
Definition:Triple.h:258
llvm::Triple::MuslEABIHF
@ MuslEABIHF
Definition:Triple.h:268
llvm::Triple::AnyHit
@ AnyHit
Definition:Triple.h:294
llvm::Triple::Amplification
@ Amplification
Definition:Triple.h:299
llvm::Triple::Intersection
@ Intersection
Definition:Triple.h:293
llvm::Triple::Hull
@ Hull
Definition:Triple.h:288
llvm::Triple::CODE16
@ CODE16
Definition:Triple.h:260
llvm::Triple::Miss
@ Miss
Definition:Triple.h:296
llvm::Triple::Geometry
@ Geometry
Definition:Triple.h:287
llvm::Triple::Callable
@ Callable
Definition:Triple.h:297
llvm::Triple::MuslX32
@ MuslX32
Definition:Triple.h:271
llvm::Triple::GNUEABIHFT64
@ GNUEABIHFT64
Definition:Triple.h:254
llvm::Triple::GNU
@ GNU
Definition:Triple.h:247
llvm::Triple::EABIHF
@ EABIHF
Definition:Triple.h:262
llvm::Triple::CoreCLR
@ CoreCLR
Definition:Triple.h:277
llvm::Triple::MuslSF
@ MuslSF
Definition:Triple.h:270
llvm::Triple::isThumb
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
Definition:Triple.h:890
llvm::Triple::isPS4
bool isPS4() const
Tests whether the target is the PS4 platform.
Definition:Triple.h:783
llvm::Triple::isPPC64ELFv2ABI
bool isPPC64ELFv2ABI() const
Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.
Definition:Triple.h:1009
llvm::Triple::isOSWASI
bool isOSWASI() const
Tests whether the OS is WASI.
Definition:Triple.h:724
llvm::Triple::isSPIR
bool isSPIR() const
Tests whether the target is SPIR (32- or 64-bit).
Definition:Triple.h:859
llvm::Triple::CanonicalForm
CanonicalForm
Canonical form.
Definition:Triple.h:370
llvm::Triple::CanonicalForm::THREE_IDENT
@ THREE_IDENT
llvm::Triple::CanonicalForm::FIVE_IDENT
@ FIVE_IDENT
llvm::Triple::CanonicalForm::FOUR_IDENT
@ FOUR_IDENT
llvm::Triple::CanonicalForm::ANY
@ ANY
llvm::Triple::isOSBinFormatWasm
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
Definition:Triple.h:768
llvm::Triple::isDriverKit
bool isDriverKit() const
Is this an Apple DriverKit triple.
Definition:Triple.h:578
llvm::Triple::getArchPointerBitWidth
unsigned getArchPointerBitWidth() const
Returns the pointer width of this architecture.
Definition:Triple.h:497
llvm::Triple::getLittleEndianArchVariant
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
Definition:Triple.cpp:1970
llvm::Triple::isOSHurd
bool isOSHurd() const
Tests whether the OS is Hurd.
Definition:Triple.h:719
llvm::Triple::isHardFloatABI
bool isHardFloatABI() const
Tests if the target forces hardfloat.
Definition:Triple.h:1101
llvm::Triple::isBPF
bool isBPF() const
Tests whether the target is eBPF.
Definition:Triple.h:1089
llvm::Triple::isX32
bool isX32() const
Tests whether the target is X32.
Definition:Triple.h:1083
llvm::Triple::getVendorTypeName
static StringRef getVendorTypeName(VendorType Kind)
Get the canonical name for the Kind vendor.
Definition:Triple.cpp:254
llvm::Triple::getObjectFormat
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition:Triple.h:421
llvm::Triple::isAArch64
bool isAArch64(int PointerWidth) const
Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.
Definition:Triple.h:958
llvm::Triple::getSubArch
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
Definition:Triple.h:398
llvm::Triple::isX86
bool isX86() const
Tests whether the target is x86 (32- or 64-bit).
Definition:Triple.h:1051
llvm::Triple::isArm64e
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition:Triple.h:1071
llvm::Triple::normalize
std::string normalize(CanonicalForm Form=CanonicalForm::ANY) const
Return the normalized form of this triple's string.
Definition:Triple.h:386
llvm::Triple::isTargetEHABICompatible
bool isTargetEHABICompatible() const
Tests whether the target supports the EHABI exception handling standard.
Definition:Triple.h:901
llvm::Triple::isOSBinFormatGOFF
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
Definition:Triple.h:760
llvm::Triple::isWindowsGNUEnvironment
bool isWindowsGNUEnvironment() const
Definition:Triple.h:688
llvm::Triple::setVendorName
void setVendorName(StringRef Str)
Set the vendor (second) component of the triple by name.
Definition:Triple.cpp:1620
llvm::Triple::OSType
OSType
Definition:Triple.h:199
llvm::Triple::Darwin
@ Darwin
Definition:Triple.h:202
llvm::Triple::AMDHSA
@ AMDHSA
Definition:Triple.h:223
llvm::Triple::DragonFly
@ DragonFly
Definition:Triple.h:203
llvm::Triple::OpenBSD
@ OpenBSD
Definition:Triple.h:212
llvm::Triple::TvOS
@ TvOS
Definition:Triple.h:227
llvm::Triple::Lv2
@ Lv2
Definition:Triple.h:209
llvm::Triple::Serenity
@ Serenity
Definition:Triple.h:240
llvm::Triple::UnknownOS
@ UnknownOS
Definition:Triple.h:200
llvm::Triple::LastOSType
@ LastOSType
Definition:Triple.h:242
llvm::Triple::HermitCore
@ HermitCore
Definition:Triple.h:234
llvm::Triple::Haiku
@ Haiku
Definition:Triple.h:217
llvm::Triple::AIX
@ AIX
Definition:Triple.h:220
llvm::Triple::DriverKit
@ DriverKit
Definition:Triple.h:230
llvm::Triple::RTEMS
@ RTEMS
Definition:Triple.h:218
llvm::Triple::PS4
@ PS4
Definition:Triple.h:224
llvm::Triple::FreeBSD
@ FreeBSD
Definition:Triple.h:204
llvm::Triple::KFreeBSD
@ KFreeBSD
Definition:Triple.h:207
llvm::Triple::PS5
@ PS5
Definition:Triple.h:225
llvm::Triple::MacOSX
@ MacOSX
Definition:Triple.h:210
llvm::Triple::NVCL
@ NVCL
Definition:Triple.h:222
llvm::Triple::Linux
@ Linux
Definition:Triple.h:208
llvm::Triple::UEFI
@ UEFI
Definition:Triple.h:214
llvm::Triple::AMDPAL
@ AMDPAL
Definition:Triple.h:233
llvm::Triple::Mesa3D
@ Mesa3D
Definition:Triple.h:232
llvm::Triple::Vulkan
@ Vulkan
Definition:Triple.h:241
llvm::Triple::WatchOS
@ WatchOS
Definition:Triple.h:228
llvm::Triple::Fuchsia
@ Fuchsia
Definition:Triple.h:205
llvm::Triple::NaCl
@ NaCl
Definition:Triple.h:219
llvm::Triple::WASI
@ WASI
Definition:Triple.h:236
llvm::Triple::XROS
@ XROS
Definition:Triple.h:231
llvm::Triple::BridgeOS
@ BridgeOS
Definition:Triple.h:229
llvm::Triple::ShaderModel
@ ShaderModel
Definition:Triple.h:238
llvm::Triple::Solaris
@ Solaris
Definition:Triple.h:213
llvm::Triple::CUDA
@ CUDA
Definition:Triple.h:221
llvm::Triple::NetBSD
@ NetBSD
Definition:Triple.h:211
llvm::Triple::Emscripten
@ Emscripten
Definition:Triple.h:237
llvm::Triple::ELFIAMCU
@ ELFIAMCU
Definition:Triple.h:226
llvm::Triple::Hurd
@ Hurd
Definition:Triple.h:235
llvm::Triple::LiteOS
@ LiteOS
Definition:Triple.h:239
llvm::Triple::IOS
@ IOS
Definition:Triple.h:206
llvm::Triple::Win32
@ Win32
Definition:Triple.h:215
llvm::Triple::ZOS
@ ZOS
Definition:Triple.h:216
llvm::Triple::isOSNetBSD
bool isOSNetBSD() const
Definition:Triple.h:606
llvm::Triple::setOSAndEnvironmentName
void setOSAndEnvironmentName(StringRef Str)
Set the operating system and optional environment components with a single string.
Definition:Triple.cpp:1637
llvm::Triple::isAndroid
bool isAndroid() const
Tests whether the target is Android.
Definition:Triple.h:800
llvm::Triple::hasDefaultTLSDESC
bool hasDefaultTLSDESC() const
True if the target supports both general-dynamic and TLSDESC, and TLSDESC is enabled by default.
Definition:Triple.h:1125
llvm::Triple::get64BitArchVariant
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
Definition:Triple.cpp:1825
llvm::Triple::isOSMSVCRT
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
Definition:Triple.h:698
llvm::Triple::isOSBinFormatMachO
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition:Triple.h:763
llvm::Triple::isLittleEndian
bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition:Triple.cpp:2007
llvm::Triple::setEnvironment
void setEnvironment(EnvironmentType Kind)
Set the environment (fourth) component of the triple to a known type.
Definition:Triple.cpp:1593
llvm::Triple::isABIN32
bool isABIN32() const
Definition:Triple.h:1077
llvm::Triple::getOSName
StringRef getOSName() const
Get the operating system (third) component of the triple.
Definition:Triple.cpp:1363
llvm::Triple::supportsCOMDAT
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition:Triple.h:1110
llvm::Triple::isWindowsCoreCLREnvironment
bool isWindowsCoreCLREnvironment() const
Definition:Triple.h:676
llvm::Triple::isSPIROrSPIRV
bool isSPIROrSPIRV() const
Definition:Triple.h:870
llvm::Triple::isMIPS64
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
Definition:Triple.h:983
llvm::Triple::ArchType
ArchType
Definition:Triple.h:46
llvm::Triple::thumbeb
@ thumbeb
Definition:Triple.h:84
llvm::Triple::r600
@ r600
Definition:Triple.h:73
llvm::Triple::sparcel
@ sparcel
Definition:Triple.h:79
llvm::Triple::loongarch32
@ loongarch32
Definition:Triple.h:61
llvm::Triple::x86
@ x86
Definition:Triple.h:85
llvm::Triple::x86_64
@ x86_64
Definition:Triple.h:86
llvm::Triple::LastArchType
@ LastArchType
Definition:Triple.h:108
llvm::Triple::renderscript64
@ renderscript64
Definition:Triple.h:106
llvm::Triple::xcore
@ xcore
Definition:Triple.h:87
llvm::Triple::csky
@ csky
Definition:Triple.h:58
llvm::Triple::sparcv9
@ sparcv9
Definition:Triple.h:78
llvm::Triple::amdgcn
@ amdgcn
Definition:Triple.h:74
llvm::Triple::shave
@ shave
Definition:Triple.h:101
llvm::Triple::ve
@ ve
Definition:Triple.h:107
llvm::Triple::ppcle
@ ppcle
Definition:Triple.h:70
llvm::Triple::spir
@ spir
Definition:Triple.h:95
llvm::Triple::ppc64le
@ ppc64le
Definition:Triple.h:72
llvm::Triple::hexagon
@ hexagon
Definition:Triple.h:60
llvm::Triple::spir64
@ spir64
Definition:Triple.h:96
llvm::Triple::UnknownArch
@ UnknownArch
Definition:Triple.h:47
llvm::Triple::kalimba
@ kalimba
Definition:Triple.h:100
llvm::Triple::amdil
@ amdil
Definition:Triple.h:91
llvm::Triple::mipsel
@ mipsel
Definition:Triple.h:65
llvm::Triple::aarch64_be
@ aarch64_be
Definition:Triple.h:52
llvm::Triple::hsail64
@ hsail64
Definition:Triple.h:94
llvm::Triple::msp430
@ msp430
Definition:Triple.h:68
llvm::Triple::loongarch64
@ loongarch64
Definition:Triple.h:62
llvm::Triple::bpfel
@ bpfel
Definition:Triple.h:56
llvm::Triple::renderscript32
@ renderscript32
Definition:Triple.h:105
llvm::Triple::mips
@ mips
Definition:Triple.h:64
llvm::Triple::arm
@ arm
Definition:Triple.h:49
llvm::Triple::lanai
@ lanai
Definition:Triple.h:102
llvm::Triple::tcele
@ tcele
Definition:Triple.h:82
llvm::Triple::nvptx64
@ nvptx64
Definition:Triple.h:90
llvm::Triple::avr
@ avr
Definition:Triple.h:55
llvm::Triple::dxil
@ dxil
Definition:Triple.h:59
llvm::Triple::sparc
@ sparc
Definition:Triple.h:77
llvm::Triple::mips64
@ mips64
Definition:Triple.h:66
llvm::Triple::ppc64
@ ppc64
Definition:Triple.h:71
llvm::Triple::ppc
@ ppc
Definition:Triple.h:69
llvm::Triple::thumb
@ thumb
Definition:Triple.h:83
llvm::Triple::xtensa
@ xtensa
Definition:Triple.h:88
llvm::Triple::bpfeb
@ bpfeb
Definition:Triple.h:57
llvm::Triple::wasm32
@ wasm32
Definition:Triple.h:103
llvm::Triple::hsail
@ hsail
Definition:Triple.h:93
llvm::Triple::wasm64
@ wasm64
Definition:Triple.h:104
llvm::Triple::tce
@ tce
Definition:Triple.h:81
llvm::Triple::amdil64
@ amdil64
Definition:Triple.h:92
llvm::Triple::nvptx
@ nvptx
Definition:Triple.h:89
llvm::Triple::spirv64
@ spirv64
Definition:Triple.h:99
llvm::Triple::m68k
@ m68k
Definition:Triple.h:63
llvm::Triple::riscv64
@ riscv64
Definition:Triple.h:76
llvm::Triple::mips64el
@ mips64el
Definition:Triple.h:67
llvm::Triple::riscv32
@ riscv32
Definition:Triple.h:75
llvm::Triple::arc
@ arc
Definition:Triple.h:54
llvm::Triple::aarch64
@ aarch64
Definition:Triple.h:51
llvm::Triple::spirv
@ spirv
Definition:Triple.h:97
llvm::Triple::systemz
@ systemz
Definition:Triple.h:80
llvm::Triple::aarch64_32
@ aarch64_32
Definition:Triple.h:53
llvm::Triple::armeb
@ armeb
Definition:Triple.h:50
llvm::Triple::spirv32
@ spirv32
Definition:Triple.h:98
llvm::Triple::hasDefaultDataSections
bool hasDefaultDataSections() const
Tests whether the target uses -data-sections as default.
Definition:Triple.h:1128
llvm::Triple::isOSSolaris
bool isOSSolaris() const
Definition:Triple.h:624
llvm::Triple::isRISCV32
bool isRISCV32() const
Tests whether the target is 32-bit RISC-V.
Definition:Triple.h:1026
llvm::Triple::isOSKFreeBSD
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
Definition:Triple.h:714
llvm::Triple::setTriple
void setTriple(const Twine &Str)
Set all components to the new triple Str.
Definition:Triple.cpp:1577
llvm::Triple::getOS
OSType getOS() const
Get the parsed operating system type of this triple.
Definition:Triple.h:404
llvm::Triple::getEnvironmentVersion
VersionTuple getEnvironmentVersion() const
Parse the version number from the OS name component of the triple, if present.
Definition:Triple.cpp:1386
llvm::Triple::normalize
static 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:1131
llvm::Triple::getArchTypeForLLVMName
static ArchType getArchTypeForLLVMName(StringRef Str)
The canonical type for the given LLVM architecture name (e.g., "x86").
Definition:Triple.cpp:422
llvm::Triple::isOSVersionLT
bool isOSVersionLT(const Triple &Other) const
Definition:Triple.h:536
llvm::Triple::isPPC32
bool isPPC32() const
Tests whether the target is 32-bit PowerPC (little and big endian).
Definition:Triple.h:999
llvm::Triple::getArch
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition:Triple.h:395
llvm::Triple::getTrampolineSize
unsigned getTrampolineSize() const
Returns the trampoline size in bytes for this configuration.
Definition:Triple.cpp:1714
llvm::Triple::isOSBinFormatCOFF
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition:Triple.h:755
llvm::Triple::isRISCV64
bool isRISCV64() const
Tests whether the target is 64-bit RISC-V.
Definition:Triple.h:1029
llvm::Triple::isCSKY
bool isCSKY() const
Definition:Triple.h:1066
llvm::Triple::isLoongArch64
bool isLoongArch64() const
Tests whether the target is 64-bit LoongArch.
Definition:Triple.h:972
llvm::Triple::getEnvironmentName
StringRef getEnvironmentName() const
Get the optional environment (fourth) component of the triple, or "" if empty.
Definition:Triple.cpp:1369
llvm::Triple::isSPARC32
bool isSPARC32() const
Tests whether the target is 32-bit SPARC (little and big endian).
Definition:Triple.h:1035
llvm::Triple::isSimulatorEnvironment
bool isSimulatorEnvironment() const
Definition:Triple.h:592
llvm::Triple::getDXILVersion
VersionTuple getDXILVersion() const
Parse the DXIL version number from the OSVersion and DXIL version (SubArch).
Definition:Triple.cpp:1564
llvm::Triple::str
const std::string & str() const
Definition:Triple.h:462
llvm::Triple::isOSzOS
bool isOSzOS() const
Definition:Triple.h:580
llvm::Triple::isOSSerenity
bool isOSSerenity() const
Definition:Triple.h:745
llvm::Triple::isOHOSFamily
bool isOHOSFamily() const
Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.
Definition:Triple.h:829
llvm::Triple::getEnvironment
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
Definition:Triple.h:412
llvm::Triple::isOSOpenBSD
bool isOSOpenBSD() const
Definition:Triple.h:610
llvm::Triple::getVulkanVersion
VersionTuple getVulkanVersion() const
Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).
Definition:Triple.cpp:1539
llvm::Triple::isOSUnknown
bool isOSUnknown() const
Definition:Triple.h:632
llvm::Triple::getDriverKitVersion
VersionTuple getDriverKitVersion() const
Parse the version number as with getOSVersion.
Definition:Triple.cpp:1527
llvm::Triple::isMIPS32
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
Definition:Triple.h:978
llvm::Triple::isShaderModelOS
bool isShaderModelOS() const
Definition:Triple.h:840
llvm::Triple::isUEFI
bool isUEFI() const
Tests whether the OS is UEFI.
Definition:Triple.h:650
llvm::Triple::isOSWindows
bool isOSWindows() const
Tests whether the OS is Windows.
Definition:Triple.h:655
llvm::Triple::isMusl
bool isMusl() const
Tests whether the environment is musl-libc.
Definition:Triple.h:815
llvm::Triple::getTriple
const std::string & getTriple() const
Definition:Triple.h:464
llvm::Triple::getArchTypeName
static StringRef getArchTypeName(ArchType Kind)
Get the canonical name for the Kind architecture.
Definition:Triple.cpp:24
llvm::Triple::isOSBinFormatDXContainer
bool isOSBinFormatDXContainer() const
Tests whether the OS uses the DXContainer binary format.
Definition:Triple.h:778
llvm::Triple::isOSBinFormatXCOFF
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition:Triple.h:773
llvm::Triple::getOSTypeName
static StringRef getOSTypeName(OSType Kind)
Get the canonical name for the Kind operating system.
Definition:Triple.cpp:278
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition:Triple.h:307
llvm::Triple::XCOFF
@ XCOFF
Definition:Triple.h:317
llvm::Triple::MachO
@ MachO
Definition:Triple.h:314
llvm::Triple::DXContainer
@ DXContainer
Definition:Triple.h:311
llvm::Triple::ELF
@ ELF
Definition:Triple.h:312
llvm::Triple::Wasm
@ Wasm
Definition:Triple.h:316
llvm::Triple::GOFF
@ GOFF
Definition:Triple.h:313
llvm::Triple::COFF
@ COFF
Definition:Triple.h:310
llvm::Triple::SPIRV
@ SPIRV
Definition:Triple.h:315
llvm::Triple::UnknownObjectFormat
@ UnknownObjectFormat
Definition:Triple.h:308
llvm::Triple::isARM
bool isARM() const
Tests whether the target is ARM (little and big endian).
Definition:Triple.h:895
llvm::Triple::merge
std::string merge(const Triple &Other) const
Merge target triples.
Definition:Triple.cpp:2094
llvm::Triple::isArmMClass
bool isArmMClass() const
Tests whether the target is an M-class.
Definition:Triple.h:936
llvm::Triple::isOSLinux
bool isOSLinux() const
Tests whether the OS is Linux.
Definition:Triple.h:709
llvm::Triple::isRISCV
bool isRISCV() const
Tests whether the target is RISC-V (32- and 64-bit).
Definition:Triple.h:1032
llvm::Triple::isAMDGCN
bool isAMDGCN() const
Tests whether the target is AMDGCN.
Definition:Triple.h:883
llvm::Triple::isAMDGPU
bool isAMDGPU() const
Definition:Triple.h:885
llvm::Triple::isLoongArch32
bool isLoongArch32() const
Tests whether the target is 32-bit LoongArch.
Definition:Triple.h:969
llvm::Triple::isOSLiteOS
bool isOSLiteOS() const
Definition:Triple.h:833
llvm::Triple::VendorType
VendorType
Definition:Triple.h:180
llvm::Triple::UnknownVendor
@ UnknownVendor
Definition:Triple.h:181
llvm::Triple::OpenEmbedded
@ OpenEmbedded
Definition:Triple.h:195
llvm::Triple::Apple
@ Apple
Definition:Triple.h:183
llvm::Triple::AMD
@ AMD
Definition:Triple.h:192
llvm::Triple::SUSE
@ SUSE
Definition:Triple.h:194
llvm::Triple::Freescale
@ Freescale
Definition:Triple.h:186
llvm::Triple::ImaginationTechnologies
@ ImaginationTechnologies
Definition:Triple.h:188
llvm::Triple::Mesa
@ Mesa
Definition:Triple.h:193
llvm::Triple::Intel
@ Intel
Definition:Triple.h:196
llvm::Triple::LastVendorType
@ LastVendorType
Definition:Triple.h:197
llvm::Triple::MipsTechnologies
@ MipsTechnologies
Definition:Triple.h:189
llvm::Triple::IBM
@ IBM
Definition:Triple.h:187
llvm::Triple::NVIDIA
@ NVIDIA
Definition:Triple.h:190
llvm::Triple::CSR
@ CSR
Definition:Triple.h:191
llvm::Triple::SCEI
@ SCEI
Definition:Triple.h:185
llvm::Triple::PC
@ PC
Definition:Triple.h:184
llvm::Triple::isNVPTX
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
Definition:Triple.h:878
llvm::Triple::isOSAIX
bool isOSAIX() const
Tests whether the OS is AIX.
Definition:Triple.h:741
llvm::Triple::getMinimumSupportedOSVersion
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Definition:Triple.cpp:2120
llvm::Triple::isArch64Bit
bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition:Triple.cpp:1734
llvm::Triple::getOSAndEnvironmentName
StringRef getOSAndEnvironmentName() const
Get the operating system and optional environment components as a single string (separated by a '-' i...
Definition:Triple.cpp:1375
llvm::Triple::SubArchType
SubArchType
Definition:Triple.h:110
llvm::Triple::ARMSubArch_v6t2
@ ARMSubArch_v6t2
Definition:Triple.h:143
llvm::Triple::NoSubArch
@ NoSubArch
Definition:Triple.h:111
llvm::Triple::MipsSubArch_r6
@ MipsSubArch_r6
Definition:Triple.h:155
llvm::Triple::DXILSubArch_v1_2
@ DXILSubArch_v1_2
Definition:Triple.h:171
llvm::Triple::ARMSubArch_v7
@ ARMSubArch_v7
Definition:Triple.h:134
llvm::Triple::ARMSubArch_v8m_mainline
@ ARMSubArch_v8m_mainline
Definition:Triple.h:132
llvm::Triple::ARMSubArch_v9_6a
@ ARMSubArch_v9_6a
Definition:Triple.h:113
llvm::Triple::ARMSubArch_v8r
@ ARMSubArch_v8r
Definition:Triple.h:130
llvm::Triple::ARMSubArch_v9_1a
@ ARMSubArch_v9_1a
Definition:Triple.h:118
llvm::Triple::DXILSubArch_v1_1
@ DXILSubArch_v1_1
Definition:Triple.h:170
llvm::Triple::LatestDXILSubArch
@ LatestDXILSubArch
Definition:Triple.h:178
llvm::Triple::SPIRVSubArch_v10
@ SPIRVSubArch_v10
Definition:Triple.h:160
llvm::Triple::SPIRVSubArch_v13
@ SPIRVSubArch_v13
Definition:Triple.h:163
llvm::Triple::ARMSubArch_v7k
@ ARMSubArch_v7k
Definition:Triple.h:138
llvm::Triple::ARMSubArch_v8_7a
@ ARMSubArch_v8_7a
Definition:Triple.h:122
llvm::Triple::ARMSubArch_v8
@ ARMSubArch_v8
Definition:Triple.h:129
llvm::Triple::SPIRVSubArch_v16
@ SPIRVSubArch_v16
Definition:Triple.h:166
llvm::Triple::ARMSubArch_v8_1a
@ ARMSubArch_v8_1a
Definition:Triple.h:128
llvm::Triple::ARMSubArch_v9_2a
@ ARMSubArch_v9_2a
Definition:Triple.h:117
llvm::Triple::DXILSubArch_v1_3
@ DXILSubArch_v1_3
Definition:Triple.h:172
llvm::Triple::SPIRVSubArch_v15
@ SPIRVSubArch_v15
Definition:Triple.h:165
llvm::Triple::ARMSubArch_v7m
@ ARMSubArch_v7m
Definition:Triple.h:136
llvm::Triple::ARMSubArch_v6k
@ ARMSubArch_v6k
Definition:Triple.h:142
llvm::Triple::ARMSubArch_v5
@ ARMSubArch_v5
Definition:Triple.h:144
llvm::Triple::AArch64SubArch_arm64e
@ AArch64SubArch_arm64e
Definition:Triple.h:148
llvm::Triple::ARMSubArch_v6
@ ARMSubArch_v6
Definition:Triple.h:140
llvm::Triple::ARMSubArch_v9_5a
@ ARMSubArch_v9_5a
Definition:Triple.h:114
llvm::Triple::ARMSubArch_v7ve
@ ARMSubArch_v7ve
Definition:Triple.h:139
llvm::Triple::ARMSubArch_v8m_baseline
@ ARMSubArch_v8m_baseline
Definition:Triple.h:131
llvm::Triple::ARMSubArch_v8_8a
@ ARMSubArch_v8_8a
Definition:Triple.h:121
llvm::Triple::ARMSubArch_v8_2a
@ ARMSubArch_v8_2a
Definition:Triple.h:127
llvm::Triple::ARMSubArch_v7s
@ ARMSubArch_v7s
Definition:Triple.h:137
llvm::Triple::DXILSubArch_v1_0
@ DXILSubArch_v1_0
Definition:Triple.h:169
llvm::Triple::DXILSubArch_v1_7
@ DXILSubArch_v1_7
Definition:Triple.h:176
llvm::Triple::KalimbaSubArch_v3
@ KalimbaSubArch_v3
Definition:Triple.h:151
llvm::Triple::DXILSubArch_v1_5
@ DXILSubArch_v1_5
Definition:Triple.h:174
llvm::Triple::ARMSubArch_v8_4a
@ ARMSubArch_v8_4a
Definition:Triple.h:125
llvm::Triple::ARMSubArch_v8_9a
@ ARMSubArch_v8_9a
Definition:Triple.h:120
llvm::Triple::ARMSubArch_v7em
@ ARMSubArch_v7em
Definition:Triple.h:135
llvm::Triple::SPIRVSubArch_v12
@ SPIRVSubArch_v12
Definition:Triple.h:162
llvm::Triple::SPIRVSubArch_v14
@ SPIRVSubArch_v14
Definition:Triple.h:164
llvm::Triple::KalimbaSubArch_v4
@ KalimbaSubArch_v4
Definition:Triple.h:152
llvm::Triple::ARMSubArch_v8_1m_mainline
@ ARMSubArch_v8_1m_mainline
Definition:Triple.h:133
llvm::Triple::ARMSubArch_v8_3a
@ ARMSubArch_v8_3a
Definition:Triple.h:126
llvm::Triple::AArch64SubArch_arm64ec
@ AArch64SubArch_arm64ec
Definition:Triple.h:149
llvm::Triple::ARMSubArch_v8_6a
@ ARMSubArch_v8_6a
Definition:Triple.h:123
llvm::Triple::ARMSubArch_v5te
@ ARMSubArch_v5te
Definition:Triple.h:145
llvm::Triple::KalimbaSubArch_v5
@ KalimbaSubArch_v5
Definition:Triple.h:153
llvm::Triple::ARMSubArch_v4t
@ ARMSubArch_v4t
Definition:Triple.h:146
llvm::Triple::DXILSubArch_v1_6
@ DXILSubArch_v1_6
Definition:Triple.h:175
llvm::Triple::DXILSubArch_v1_8
@ DXILSubArch_v1_8
Definition:Triple.h:177
llvm::Triple::ARMSubArch_v9_4a
@ ARMSubArch_v9_4a
Definition:Triple.h:115
llvm::Triple::ARMSubArch_v8_5a
@ ARMSubArch_v8_5a
Definition:Triple.h:124
llvm::Triple::ARMSubArch_v6m
@ ARMSubArch_v6m
Definition:Triple.h:141
llvm::Triple::ARMSubArch_v9_3a
@ ARMSubArch_v9_3a
Definition:Triple.h:116
llvm::Triple::ARMSubArch_v9
@ ARMSubArch_v9
Definition:Triple.h:119
llvm::Triple::DXILSubArch_v1_4
@ DXILSubArch_v1_4
Definition:Triple.h:173
llvm::Triple::SPIRVSubArch_v11
@ SPIRVSubArch_v11
Definition:Triple.h:161
llvm::Triple::PPCSubArch_spe
@ PPCSubArch_spe
Definition:Triple.h:157
llvm::Triple::getMacOSXVersion
bool getMacOSXVersion(VersionTuple &Version) const
Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...
Definition:Triple.cpp:1427
llvm::Triple::isSPARC64
bool isSPARC64() const
Tests whether the target is 64-bit SPARC (big endian).
Definition:Triple.h:1040
llvm::Triple::isWindowsCygwinEnvironment
bool isWindowsCygwinEnvironment() const
Definition:Triple.h:684
llvm::Triple::isMacOSX
bool isMacOSX() const
Is this a Mac OS X triple.
Definition:Triple.h:547
llvm::Triple::isOSFreeBSD
bool isOSFreeBSD() const
Definition:Triple.h:614
llvm::Triple::isXROS
bool isXROS() const
Is this an Apple XROS triple.
Definition:Triple.h:575
llvm::Triple::setEnvironmentName
void setEnvironmentName(StringRef Str)
Set the optional environment (fourth) component of the triple by name.
Definition:Triple.cpp:1632
llvm::Triple::setOS
void setOS(OSType Kind)
Set the operating system (third) component of the triple to a known type.
Definition:Triple.cpp:1589
llvm::Triple::setOSName
void setOSName(StringRef Str)
Set the operating system (third) component of the triple by name.
Definition:Triple.cpp:1624
llvm::Triple::getVendor
VendorType getVendor() const
Get the parsed vendor type of this triple.
Definition:Triple.h:401
llvm::Triple::isSPARC
bool isSPARC() const
Tests whether the target is SPARC.
Definition:Triple.h:1043
llvm::Triple::isPPC64
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
Definition:Triple.h:1004
llvm::Triple::isOSDarwin
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, XROS, or DriverKit).
Definition:Triple.h:588
llvm::Triple::hasDLLImportExport
bool hasDLLImportExport() const
Tests if the environment supports dllimport/export annotations.
Definition:Triple.h:1133
llvm::Triple::isSPIRVLogical
bool isSPIRVLogical() const
Tests whether the target is SPIR-V Logical.
Definition:Triple.h:873
llvm::Triple::getEnvironmentTypeName
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
Definition:Triple.cpp:327
llvm::Triple::isOSVersionLT
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:525
llvm::Triple::isTvOS
bool isTvOS() const
Is this an Apple tvOS triple.
Definition:Triple.h:561
llvm::Triple::isOSEmscripten
bool isOSEmscripten() const
Tests whether the OS is Emscripten.
Definition:Triple.h:729
llvm::Triple::isWindowsArm64EC
bool isWindowsArm64EC() const
Definition:Triple.h:671
llvm::Triple::operator==
bool operator==(const Triple &Other) const
Definition:Triple.h:354
llvm::Triple::isWatchOS
bool isWatchOS() const
Is this an Apple watchOS triple.
Definition:Triple.h:566
llvm::Triple::isiOS
bool isiOS() const
Is this an iOS triple.
Definition:Triple.h:556
llvm::Triple::isMIPS
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
Definition:Triple.h:988
llvm::Triple::isOSGlibc
bool isOSGlibc() const
Tests whether the OS uses glibc.
Definition:Triple.h:734
llvm::Triple::getCanonicalVersionForOS
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
Definition:Triple.cpp:2154
llvm::Triple::isPS
bool isPS() const
Tests whether the target is the PS4 or PS5 platform.
Definition:Triple.h:797
llvm::Triple::isWasm
bool isWasm() const
Tests whether the target is wasm (32- and 64-bit).
Definition:Triple.h:1061
llvm::Triple::isVulkanOS
bool isVulkanOS() const
Definition:Triple.h:844
llvm::Triple::getArchName
StringRef getArchName() const
Get the architecture (first) component of the triple.
Definition:Triple.cpp:1354
llvm::Triple::isOSIAMCU
bool isOSIAMCU() const
Definition:Triple.h:628
llvm::Triple::isOpenHOS
bool isOpenHOS() const
Definition:Triple.h:831
llvm::Triple::isMacCatalystEnvironment
bool isMacCatalystEnvironment() const
Definition:Triple.h:596
llvm::Triple::isPS5
bool isPS5() const
Tests whether the target is the PS5 platform.
Definition:Triple.h:790
llvm::Triple::isSPIRV
bool isSPIRV() const
Tests whether the target is SPIR-V (32/64-bit/Logical).
Definition:Triple.h:864
llvm::Triple::isAArch64
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
Definition:Triple.h:951
llvm::Triple::getObjectFormatTypeName
static StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)
Get the name for the Object format.
Definition:Triple.cpp:392
llvm::Triple::isAppleMachO
bool isAppleMachO() const
Is this an Apple MachO triple.
Definition:Triple.h:583
llvm::Triple::isArch16Bit
bool isArch16Bit() const
Test whether the architecture is 16-bit.
Definition:Triple.cpp:1742
llvm::Triple::getBigEndianArchVariant
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
Definition:Triple.cpp:1904
llvm::Triple::getiOSVersion
VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition:Triple.cpp:1472
llvm::Triple::hasDefaultEmulatedTLS
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
Definition:Triple.h:1118
llvm::Triple::isSystemZ
bool isSystemZ() const
Tests whether the target is SystemZ.
Definition:Triple.h:1046
llvm::Triple::getEnvironmentVersionString
StringRef getEnvironmentVersionString() const
Get the version component of the environment component as a single string (the version after the envi...
Definition:Triple.cpp:1390
llvm::Triple::isPPC32SecurePlt
bool isPPC32SecurePlt() const
Tests whether the target 32-bit PowerPC uses Secure PLT.
Definition:Triple.h:1017
llvm::Triple::isTime64ABI
bool isTime64ABI() const
Tests if the target forces 64-bit time_t on a 32-bit architecture.
Definition:Triple.h:1094
llvm::Triple::isArch32Bit
bool isArch32Bit() const
Test whether the architecture is 32-bit.
Definition:Triple.cpp:1738
llvm::Triple::operator!=
bool operator!=(const Triple &Other) const
Definition:Triple.h:361
llvm::Triple::getOSMajorVersion
unsigned getOSMajorVersion() const
Return just the major version number, this is specialized because it is a common query.
Definition:Triple.h:431
llvm::Triple::isCompatibleWith
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
Definition:Triple.cpp:2059
llvm::Triple::isOSFuchsia
bool isOSFuchsia() const
Definition:Triple.h:618
llvm::Triple::isOSBinFormatELF
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition:Triple.h:750
llvm::Triple::isWindowsMSVCEnvironment
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Definition:Triple.h:665
llvm::Triple::hasEnvironment
bool hasEnvironment() const
Does this triple have the optional environment (fourth) component?
Definition:Triple.h:407
llvm::Triple::isKnownWindowsMSVCEnvironment
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
Definition:Triple.h:660
llvm::Triple::getArchTypePrefix
static StringRef getArchTypePrefix(ArchType Kind)
Get the "prefix" canonical name for the Kind architecture.
Definition:Triple.cpp:167
llvm::Triple::isOSHaiku
bool isOSHaiku() const
Tests whether the OS is Haiku.
Definition:Triple.h:645
llvm::Triple::setArch
void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)
Set the architecture (first) component of the triple to a known type.
Definition:Triple.cpp:1581
llvm::Triple::isDXIL
bool isDXIL() const
Tests whether the target is DXIL.
Definition:Triple.h:836
llvm::Triple::setVendor
void setVendor(VendorType Kind)
Set the vendor (second) component of the triple to a known type.
Definition:Triple.cpp:1585
llvm::Triple::isGNUEnvironment
bool isGNUEnvironment() const
Definition:Triple.h:634
llvm::Triple::isLoongArch
bool isLoongArch() const
Tests whether the target is LoongArch (32- and 64-bit).
Definition:Triple.h:975
llvm::Triple::isShaderStageEnvironment
bool isShaderStageEnvironment() const
Definition:Triple.h:846
llvm::Triple::isWindowsItaniumEnvironment
bool isWindowsItaniumEnvironment() const
Definition:Triple.h:680
llvm::Triple::isVE
bool isVE() const
Tests whether the target is VE.
Definition:Triple.h:1056
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:Twine.h:81
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition:VersionTuple.h:29
llvm::VersionTuple::getMajor
unsigned getMajor() const
Retrieve the major version number.
Definition:VersionTuple.h:71
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::Version
@ Version
Definition:PGOCtxProfWriter.h:22

Generated on Sun Jul 20 2025 07:40:53 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp