LLVM  14.0.0git
Triple.h
Go to the documentation of this file.
1 //===-- llvm/ADT/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_ADT_TRIPLE_H
10 #define LLVM_ADT_TRIPLE_H
11 
12 #include "llvm/ADT/Twine.h"
13 
14 // Some system headers or GCC predefined macros conflict with identifiers in
15 // this file. Undefine them here.
16 #undef NetBSD
17 #undef mips
18 #undef sparc
19 
20 namespace llvm {
21 
22 class VersionTuple;
23 
24 /// Triple - Helper class for working with autoconf configuration names. For
25 /// historical reasons, we also call these 'triples' (they used to contain
26 /// exactly three fields).
27 ///
28 /// Configuration names are strings in the canonical form:
29 /// ARCHITECTURE-VENDOR-OPERATING_SYSTEM
30 /// or
31 /// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
32 ///
33 /// This class is used for clients which want to support arbitrary
34 /// configuration names, but also want to implement certain special
35 /// behavior for particular configurations. This class isolates the mapping
36 /// from the components of the configuration name to well known IDs.
37 ///
38 /// At its core the Triple class is designed to be a wrapper for a triple
39 /// string; the constructor does not change or normalize the triple string.
40 /// Clients that need to handle the non-canonical triples that users often
41 /// specify should use the normalize method.
42 ///
43 /// See autoconf/config.guess for a glimpse into what configuration names
44 /// look like in practice.
45 class Triple {
46 public:
47  enum ArchType {
49 
50  arm, // ARM (little endian): arm, armv.*, xscale
51  armeb, // ARM (big endian): armeb
52  aarch64, // AArch64 (little endian): aarch64
53  aarch64_be, // AArch64 (big endian): aarch64_be
54  aarch64_32, // AArch64 (little endian) ILP32: aarch64_32
55  arc, // ARC: Synopsys ARC
56  avr, // AVR: Atmel AVR microcontroller
57  bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
58  bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
59  csky, // CSKY: csky
60  hexagon, // Hexagon: hexagon
61  m68k, // M68k: Motorola 680x0 family
62  mips, // MIPS: mips, mipsallegrex, mipsr6
63  mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
64  mips64, // MIPS64: mips64, mips64r6, mipsn32, mipsn32r6
65  mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
66  msp430, // MSP430: msp430
67  ppc, // PPC: powerpc
68  ppcle, // PPCLE: powerpc (little endian)
69  ppc64, // PPC64: powerpc64, ppu
70  ppc64le, // PPC64LE: powerpc64le
71  r600, // R600: AMD GPUs HD2XXX - HD6XXX
72  amdgcn, // AMDGCN: AMD GCN GPUs
73  riscv32, // RISC-V (32-bit): riscv32
74  riscv64, // RISC-V (64-bit): riscv64
75  sparc, // Sparc: sparc
76  sparcv9, // Sparcv9: Sparcv9
77  sparcel, // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant
78  systemz, // SystemZ: s390x
79  tce, // TCE (http://tce.cs.tut.fi/): tce
80  tcele, // TCE little endian (http://tce.cs.tut.fi/): tcele
81  thumb, // Thumb (little endian): thumb, thumbv.*
82  thumbeb, // Thumb (big endian): thumbeb
83  x86, // X86: i[3-9]86
84  x86_64, // X86-64: amd64, x86_64
85  xcore, // XCore: xcore
86  nvptx, // NVPTX: 32-bit
87  nvptx64, // NVPTX: 64-bit
88  le32, // le32: generic little-endian 32-bit CPU (PNaCl)
89  le64, // le64: generic little-endian 64-bit CPU (PNaCl)
90  amdil, // AMDIL
91  amdil64, // AMDIL with 64-bit pointers
92  hsail, // AMD HSAIL
93  hsail64, // AMD HSAIL with 64-bit pointers
94  spir, // SPIR: standard portable IR for OpenCL 32-bit version
95  spir64, // SPIR: standard portable IR for OpenCL 64-bit version
96  kalimba, // Kalimba: generic kalimba
97  shave, // SHAVE: Movidius vector VLIW processors
98  lanai, // Lanai: Lanai 32-bit
99  wasm32, // WebAssembly with 32-bit pointers
100  wasm64, // WebAssembly with 64-bit pointers
101  renderscript32, // 32-bit RenderScript
102  renderscript64, // 64-bit RenderScript
103  ve, // NEC SX-Aurora Vector Engine
105  };
106  enum SubArchType {
108 
134 
136 
140 
142 
144  };
145  enum VendorType {
147 
149  PC,
163  };
164  enum OSType {
166 
176  Lv2, // PS3
186  NaCl, // Native Client
188  CUDA, // NVIDIA CUDA
189  NVCL, // NVIDIA OpenCL
190  AMDHSA, // AMD HSA Runtime
193  TvOS, // Apple tvOS
194  WatchOS, // Apple watchOS
197  AMDPAL, // AMD PAL Runtime
198  HermitCore, // HermitCore Unikernel/Multikernel
199  Hurd, // GNU/Hurd
200  WASI, // Experimental WebAssembly OS
203  };
206 
222 
227  Simulator, // Simulator variants of other systems, e.g., Apple's iOS
228  MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
230  };
233 
240  };
241 
242 private:
243  std::string Data;
244 
245  /// The parsed arch type.
246  ArchType Arch;
247 
248  /// The parsed subarchitecture type.
249  SubArchType SubArch;
250 
251  /// The parsed vendor type.
252  VendorType Vendor;
253 
254  /// The parsed OS type.
255  OSType OS;
256 
257  /// The parsed Environment type.
258  EnvironmentType Environment;
259 
260  /// The object format type.
261  ObjectFormatType ObjectFormat;
262 
263 public:
264  /// @name Constructors
265  /// @{
266 
267  /// Default constructor is the same as an empty string and leaves all
268  /// triple fields unknown.
270  : Data(), Arch(), SubArch(), Vendor(), OS(), Environment(),
271  ObjectFormat() {}
272 
273  explicit Triple(const Twine &Str);
274  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr);
275  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
276  const Twine &EnvironmentStr);
277 
278  bool operator==(const Triple &Other) const {
279  return Arch == Other.Arch && SubArch == Other.SubArch &&
280  Vendor == Other.Vendor && OS == Other.OS &&
281  Environment == Other.Environment &&
282  ObjectFormat == Other.ObjectFormat;
283  }
284 
285  bool operator!=(const Triple &Other) const {
286  return !(*this == Other);
287  }
288 
289  /// @}
290  /// @name Normalization
291  /// @{
292 
293  /// normalize - Turn an arbitrary machine specification into the canonical
294  /// triple form (or something sensible that the Triple class understands if
295  /// nothing better can reasonably be done). In particular, it handles the
296  /// common case in which otherwise valid components are in the wrong order.
297  static std::string normalize(StringRef Str);
298 
299  /// Return the normalized form of this triple's string.
300  std::string normalize() const { return normalize(Data); }
301 
302  /// @}
303  /// @name Typed Component Access
304  /// @{
305 
306  /// getArch - Get the parsed architecture type of this triple.
307  ArchType getArch() const { return Arch; }
308 
309  /// getSubArch - get the parsed subarchitecture type for this triple.
310  SubArchType getSubArch() const { return SubArch; }
311 
312  /// getVendor - Get the parsed vendor type of this triple.
313  VendorType getVendor() const { return Vendor; }
314 
315  /// getOS - Get the parsed operating system type of this triple.
316  OSType getOS() const { return OS; }
317 
318  /// hasEnvironment - Does this triple have the optional environment
319  /// (fourth) component?
320  bool hasEnvironment() const {
321  return getEnvironmentName() != "";
322  }
323 
324  /// getEnvironment - Get the parsed environment type of this triple.
325  EnvironmentType getEnvironment() const { return Environment; }
326 
327  /// Parse the version number from the OS name component of the
328  /// triple, if present.
329  ///
330  /// For example, "fooos1.2.3" would return (1, 2, 3).
331  ///
332  /// If an entry is not defined, it will be returned as 0.
333  void getEnvironmentVersion(unsigned &Major, unsigned &Minor,
334  unsigned &Micro) const;
335 
336  /// getFormat - Get the object format for this triple.
337  ObjectFormatType getObjectFormat() const { return ObjectFormat; }
338 
339  /// getOSVersion - Parse the version number from the OS name component of the
340  /// triple, if present.
341  ///
342  /// For example, "fooos1.2.3" would return (1, 2, 3).
343  ///
344  /// If an entry is not defined, it will be returned as 0.
345  void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const;
346 
347  /// getOSMajorVersion - Return just the major version number, this is
348  /// specialized because it is a common query.
349  unsigned getOSMajorVersion() const {
350  unsigned Maj, Min, Micro;
351  getOSVersion(Maj, Min, Micro);
352  return Maj;
353  }
354 
355  /// getMacOSXVersion - Parse the version number as with getOSVersion and then
356  /// translate generic "darwin" versions to the corresponding OS X versions.
357  /// This may also be called with IOS triples but the OS X version number is
358  /// just set to a constant 10.4.0 in that case. Returns true if successful.
359  bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
360  unsigned &Micro) const;
361 
362  /// getiOSVersion - Parse the version number as with getOSVersion. This should
363  /// only be called with IOS or generic triples.
364  void getiOSVersion(unsigned &Major, unsigned &Minor,
365  unsigned &Micro) const;
366 
367  /// getWatchOSVersion - Parse the version number as with getOSVersion. This
368  /// should only be called with WatchOS or generic triples.
369  void getWatchOSVersion(unsigned &Major, unsigned &Minor,
370  unsigned &Micro) const;
371 
372  /// @}
373  /// @name Direct Component Access
374  /// @{
375 
376  const std::string &str() const { return Data; }
377 
378  const std::string &getTriple() const { return Data; }
379 
380  /// getArchName - Get the architecture (first) component of the
381  /// triple.
382  StringRef getArchName() const;
383 
384  /// getVendorName - Get the vendor (second) component of the triple.
385  StringRef getVendorName() const;
386 
387  /// getOSName - Get the operating system (third) component of the
388  /// triple.
389  StringRef getOSName() const;
390 
391  /// getEnvironmentName - Get the optional environment (fourth)
392  /// component of the triple, or "" if empty.
394 
395  /// getOSAndEnvironmentName - Get the operating system and optional
396  /// environment components as a single string (separated by a '-'
397  /// if the environment component is present).
399 
400  /// @}
401  /// @name Convenience Predicates
402  /// @{
403 
404  /// Test whether the architecture is 64-bit
405  ///
406  /// Note that this tests for 64-bit pointer width, and nothing else. Note
407  /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
408  /// 16-bit. The inner details of pointer width for particular architectures
409  /// is not summed up in the triple, and so only a coarse grained predicate
410  /// system is provided.
411  bool isArch64Bit() const;
412 
413  /// Test whether the architecture is 32-bit
414  ///
415  /// Note that this tests for 32-bit pointer width, and nothing else.
416  bool isArch32Bit() const;
417 
418  /// Test whether the architecture is 16-bit
419  ///
420  /// Note that this tests for 16-bit pointer width, and nothing else.
421  bool isArch16Bit() const;
422 
423  /// isOSVersionLT - Helper function for doing comparisons against version
424  /// numbers included in the target triple.
425  bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
426  unsigned Micro = 0) const {
427  unsigned LHS[3];
428  getOSVersion(LHS[0], LHS[1], LHS[2]);
429 
430  if (LHS[0] != Major)
431  return LHS[0] < Major;
432  if (LHS[1] != Minor)
433  return LHS[1] < Minor;
434  if (LHS[2] != Micro)
435  return LHS[2] < Micro;
436 
437  return false;
438  }
439 
440  bool isOSVersionLT(const Triple &Other) const {
441  unsigned RHS[3];
442  Other.getOSVersion(RHS[0], RHS[1], RHS[2]);
443  return isOSVersionLT(RHS[0], RHS[1], RHS[2]);
444  }
445 
446  /// isMacOSXVersionLT - Comparison function for checking OS X version
447  /// compatibility, which handles supporting skewed version numbering schemes
448  /// used by the "darwin" triples.
449  bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
450  unsigned Micro = 0) const;
451 
452  /// isMacOSX - Is this a Mac OS X triple. For legacy reasons, we support both
453  /// "darwin" and "osx" as OS X triples.
454  bool isMacOSX() const {
455  return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
456  }
457 
458  /// Is this an iOS triple.
459  /// Note: This identifies tvOS as a variant of iOS. If that ever
460  /// changes, i.e., if the two operating systems diverge or their version
461  /// numbers get out of sync, that will need to be changed.
462  /// watchOS has completely different version numbers so it is not included.
463  bool isiOS() const {
464  return getOS() == Triple::IOS || isTvOS();
465  }
466 
467  /// Is this an Apple tvOS triple.
468  bool isTvOS() const {
469  return getOS() == Triple::TvOS;
470  }
471 
472  /// Is this an Apple watchOS triple.
473  bool isWatchOS() const {
474  return getOS() == Triple::WatchOS;
475  }
476 
477  bool isWatchABI() const {
479  }
480 
481  bool isOSzOS() const { return getOS() == Triple::ZOS; }
482 
483  /// isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
484  bool isOSDarwin() const {
485  return isMacOSX() || isiOS() || isWatchOS();
486  }
487 
488  bool isSimulatorEnvironment() const {
489  return getEnvironment() == Triple::Simulator;
490  }
491 
493  return getEnvironment() == Triple::MacABI;
494  }
495 
496  /// Returns true for targets that run on a macOS machine.
497  bool isTargetMachineMac() const {
498  return isMacOSX() || (isOSDarwin() && (isSimulatorEnvironment() ||
500  }
501 
502  bool isOSNetBSD() const {
503  return getOS() == Triple::NetBSD;
504  }
505 
506  bool isOSOpenBSD() const {
507  return getOS() == Triple::OpenBSD;
508  }
509 
510  bool isOSFreeBSD() const {
511  return getOS() == Triple::FreeBSD;
512  }
513 
514  bool isOSFuchsia() const {
515  return getOS() == Triple::Fuchsia;
516  }
517 
518  bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
519 
520  bool isOSSolaris() const {
521  return getOS() == Triple::Solaris;
522  }
523 
524  bool isOSIAMCU() const {
525  return getOS() == Triple::ELFIAMCU;
526  }
527 
528  bool isOSUnknown() const { return getOS() == Triple::UnknownOS; }
529 
530  bool isGNUEnvironment() const {
532  return Env == Triple::GNU || Env == Triple::GNUABIN32 ||
533  Env == Triple::GNUABI64 || Env == Triple::GNUEABI ||
534  Env == Triple::GNUEABIHF || Env == Triple::GNUX32;
535  }
536 
537  bool isOSContiki() const {
538  return getOS() == Triple::Contiki;
539  }
540 
541  /// Tests whether the OS is Haiku.
542  bool isOSHaiku() const {
543  return getOS() == Triple::Haiku;
544  }
545 
546  /// Tests whether the OS is Windows.
547  bool isOSWindows() const {
548  return getOS() == Triple::Win32;
549  }
550 
551  /// Checks if the environment is MSVC.
553  return isOSWindows() && getEnvironment() == Triple::MSVC;
554  }
555 
556  /// Checks if the environment could be MSVC.
560  }
561 
563  return isOSWindows() && getEnvironment() == Triple::CoreCLR;
564  }
565 
567  return isOSWindows() && getEnvironment() == Triple::Itanium;
568  }
569 
571  return isOSWindows() && getEnvironment() == Triple::Cygnus;
572  }
573 
574  bool isWindowsGNUEnvironment() const {
575  return isOSWindows() && getEnvironment() == Triple::GNU;
576  }
577 
578  /// Tests for either Cygwin or MinGW OS
579  bool isOSCygMing() const {
581  }
582 
583  /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
584  bool isOSMSVCRT() const {
587  }
588 
589  /// Tests whether the OS is NaCl (Native Client)
590  bool isOSNaCl() const {
591  return getOS() == Triple::NaCl;
592  }
593 
594  /// Tests whether the OS is Linux.
595  bool isOSLinux() const {
596  return getOS() == Triple::Linux;
597  }
598 
599  /// Tests whether the OS is kFreeBSD.
600  bool isOSKFreeBSD() const {
601  return getOS() == Triple::KFreeBSD;
602  }
603 
604  /// Tests whether the OS is Hurd.
605  bool isOSHurd() const {
606  return getOS() == Triple::Hurd;
607  }
608 
609  /// Tests whether the OS is WASI.
610  bool isOSWASI() const {
611  return getOS() == Triple::WASI;
612  }
613 
614  /// Tests whether the OS is Emscripten.
615  bool isOSEmscripten() const {
616  return getOS() == Triple::Emscripten;
617  }
618 
619  /// Tests whether the OS uses glibc.
620  bool isOSGlibc() const {
621  return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
622  getOS() == Triple::Hurd) &&
623  !isAndroid();
624  }
625 
626  /// Tests whether the OS is AIX.
627  bool isOSAIX() const {
628  return getOS() == Triple::AIX;
629  }
630 
631  /// Tests whether the OS uses the ELF binary format.
632  bool isOSBinFormatELF() const {
633  return getObjectFormat() == Triple::ELF;
634  }
635 
636  /// Tests whether the OS uses the COFF binary format.
637  bool isOSBinFormatCOFF() const {
638  return getObjectFormat() == Triple::COFF;
639  }
640 
641  /// Tests whether the OS uses the GOFF binary format.
642  bool isOSBinFormatGOFF() const { return getObjectFormat() == Triple::GOFF; }
643 
644  /// Tests whether the environment is MachO.
645  bool isOSBinFormatMachO() const {
646  return getObjectFormat() == Triple::MachO;
647  }
648 
649  /// Tests whether the OS uses the Wasm binary format.
650  bool isOSBinFormatWasm() const {
651  return getObjectFormat() == Triple::Wasm;
652  }
653 
654  /// Tests whether the OS uses the XCOFF binary format.
655  bool isOSBinFormatXCOFF() const {
656  return getObjectFormat() == Triple::XCOFF;
657  }
658 
659  /// Tests whether the target is the PS4 CPU
660  bool isPS4CPU() const {
661  return getArch() == Triple::x86_64 &&
662  getVendor() == Triple::SCEI &&
663  getOS() == Triple::PS4;
664  }
665 
666  /// Tests whether the target is the PS4 platform
667  bool isPS4() const {
668  return getVendor() == Triple::SCEI &&
669  getOS() == Triple::PS4;
670  }
671 
672  /// Tests whether the target is Android
673  bool isAndroid() const { return getEnvironment() == Triple::Android; }
674 
675  bool isAndroidVersionLT(unsigned Major) const {
676  assert(isAndroid() && "Not an Android triple!");
677 
678  unsigned Env[3];
679  getEnvironmentVersion(Env[0], Env[1], Env[2]);
680 
681  // 64-bit targets did not exist before API level 21 (Lollipop).
682  if (isArch64Bit() && Env[0] < 21)
683  Env[0] = 21;
684 
685  return Env[0] < Major;
686  }
687 
688  /// Tests whether the environment is musl-libc
689  bool isMusl() const {
690  return getEnvironment() == Triple::Musl ||
694  }
695 
696  /// Tests whether the target is SPIR (32- or 64-bit).
697  bool isSPIR() const {
698  return getArch() == Triple::spir || getArch() == Triple::spir64;
699  }
700 
701  /// Tests whether the target is NVPTX (32- or 64-bit).
702  bool isNVPTX() const {
703  return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
704  }
705 
706  /// Tests whether the target is AMDGCN
707  bool isAMDGCN() const { return getArch() == Triple::amdgcn; }
708 
709  bool isAMDGPU() const {
710  return getArch() == Triple::r600 || getArch() == Triple::amdgcn;
711  }
712 
713  /// Tests whether the target is Thumb (little and big endian).
714  bool isThumb() const {
715  return getArch() == Triple::thumb || getArch() == Triple::thumbeb;
716  }
717 
718  /// Tests whether the target is ARM (little and big endian).
719  bool isARM() const {
720  return getArch() == Triple::arm || getArch() == Triple::armeb;
721  }
722 
723  /// Tests whether the target is AArch64 (little and big endian).
724  bool isAArch64() const {
725  return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be ||
727  }
728 
729  /// Tests whether the target is AArch64 and pointers are the size specified by
730  /// \p PointerWidth.
731  bool isAArch64(int PointerWidth) const {
732  assert(PointerWidth == 64 || PointerWidth == 32);
733  if (!isAArch64())
734  return false;
735  return getArch() == Triple::aarch64_32 ||
737  ? PointerWidth == 32
738  : PointerWidth == 64;
739  }
740 
741  /// Tests whether the target is MIPS 32-bit (little and big endian).
742  bool isMIPS32() const {
743  return getArch() == Triple::mips || getArch() == Triple::mipsel;
744  }
745 
746  /// Tests whether the target is MIPS 64-bit (little and big endian).
747  bool isMIPS64() const {
748  return getArch() == Triple::mips64 || getArch() == Triple::mips64el;
749  }
750 
751  /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
752  bool isMIPS() const {
753  return isMIPS32() || isMIPS64();
754  }
755 
756  /// Tests whether the target is PowerPC (32- or 64-bit LE or BE).
757  bool isPPC() const {
758  return getArch() == Triple::ppc || getArch() == Triple::ppc64 ||
760  }
761 
762  /// Tests whether the target is 32-bit PowerPC (little and big endian).
763  bool isPPC32() const {
764  return getArch() == Triple::ppc || getArch() == Triple::ppcle;
765  }
766 
767  /// Tests whether the target is 64-bit PowerPC (little and big endian).
768  bool isPPC64() const {
769  return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le;
770  }
771 
772  /// Tests whether the target is RISC-V (32- and 64-bit).
773  bool isRISCV() const {
774  return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
775  }
776 
777  /// Tests whether the target is SystemZ.
778  bool isSystemZ() const {
779  return getArch() == Triple::systemz;
780  }
781 
782  /// Tests whether the target is x86 (32- or 64-bit).
783  bool isX86() const {
784  return getArch() == Triple::x86 || getArch() == Triple::x86_64;
785  }
786 
787  /// Tests whether the target is VE
788  bool isVE() const {
789  return getArch() == Triple::ve;
790  }
791 
792  /// Tests whether the target is wasm (32- and 64-bit).
793  bool isWasm() const {
794  return getArch() == Triple::wasm32 || getArch() == Triple::wasm64;
795  }
796 
797  // Tests whether the target is CSKY
798  bool isCSKY() const {
799  return getArch() == Triple::csky;
800  }
801 
802  /// Tests whether the target is the Apple "arm64e" AArch64 subarch.
803  bool isArm64e() const {
804  return getArch() == Triple::aarch64 &&
806  }
807 
808  /// Tests whether the target is X32.
809  bool isX32() const {
811  return Env == Triple::GNUX32 || Env == Triple::MuslX32;
812  }
813 
814  /// Tests whether the target supports comdat
815  bool supportsCOMDAT() const {
816  return !(isOSBinFormatMachO() || isOSBinFormatXCOFF());
817  }
818 
819  /// Tests whether the target uses emulated TLS as default.
820  bool hasDefaultEmulatedTLS() const {
822  }
823 
824  /// Tests whether the target uses -data-sections as default.
825  bool hasDefaultDataSections() const {
826  return isOSBinFormatXCOFF() || isWasm();
827  }
828 
829  /// Tests if the environment supports dllimport/export annotations.
830  bool hasDLLImportExport() const { return isOSWindows() || isPS4CPU(); }
831 
832  /// @}
833  /// @name Mutators
834  /// @{
835 
836  /// setArch - Set the architecture (first) component of the triple
837  /// to a known type.
838  void setArch(ArchType Kind);
839 
840  /// setVendor - Set the vendor (second) component of the triple to a
841  /// known type.
842  void setVendor(VendorType Kind);
843 
844  /// setOS - Set the operating system (third) component of the triple
845  /// to a known type.
846  void setOS(OSType Kind);
847 
848  /// setEnvironment - Set the environment (fourth) component of the triple
849  /// to a known type.
851 
852  /// setObjectFormat - Set the object file format
854 
855  /// setTriple - Set all components to the new triple \p Str.
856  void setTriple(const Twine &Str);
857 
858  /// setArchName - Set the architecture (first) component of the
859  /// triple by name.
860  void setArchName(StringRef Str);
861 
862  /// setVendorName - Set the vendor (second) component of the triple
863  /// by name.
864  void setVendorName(StringRef Str);
865 
866  /// setOSName - Set the operating system (third) component of the
867  /// triple by name.
868  void setOSName(StringRef Str);
869 
870  /// setEnvironmentName - Set the optional environment (fourth)
871  /// component of the triple by name.
872  void setEnvironmentName(StringRef Str);
873 
874  /// setOSAndEnvironmentName - Set the operating system and optional
875  /// environment components with a single string.
877 
878  /// @}
879  /// @name Helpers to build variants of a particular triple.
880  /// @{
881 
882  /// Form a triple with a 32-bit variant of the current architecture.
883  ///
884  /// This can be used to move across "families" of architectures where useful.
885  ///
886  /// \returns A new triple with a 32-bit architecture or an unknown
887  /// architecture if no such variant can be found.
889 
890  /// Form a triple with a 64-bit variant of the current architecture.
891  ///
892  /// This can be used to move across "families" of architectures where useful.
893  ///
894  /// \returns A new triple with a 64-bit architecture or an unknown
895  /// architecture if no such variant can be found.
897 
898  /// Form a triple with a big endian variant of the current architecture.
899  ///
900  /// This can be used to move across "families" of architectures where useful.
901  ///
902  /// \returns A new triple with a big endian architecture or an unknown
903  /// architecture if no such variant can be found.
905 
906  /// Form a triple with a little endian variant of the current architecture.
907  ///
908  /// This can be used to move across "families" of architectures where useful.
909  ///
910  /// \returns A new triple with a little endian architecture or an unknown
911  /// architecture if no such variant can be found.
913 
914  /// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
915  ///
916  /// \param Arch the architecture name (e.g., "armv7s"). If it is an empty
917  /// string then the triple's arch name is used.
919 
920  /// Tests whether the target triple is little endian.
921  ///
922  /// \returns true if the triple is little endian, false otherwise.
923  bool isLittleEndian() const;
924 
925  /// Test whether target triples are compatible.
926  bool isCompatibleWith(const Triple &Other) const;
927 
928  /// Merge target triples.
929  std::string merge(const Triple &Other) const;
930 
931  /// Some platforms have different minimum supported OS versions that
932  /// varies by the architecture specified in the triple. This function
933  /// returns the minimum supported OS version for this triple if one an exists,
934  /// or an invalid version tuple if this triple doesn't have one.
936 
937  /// @}
938  /// @name Static helpers for IDs.
939  /// @{
940 
941  /// getArchTypeName - Get the canonical name for the \p Kind architecture.
943 
944  /// getArchTypePrefix - Get the "prefix" canonical name for the \p Kind
945  /// architecture. This is the prefix used by the architecture specific
946  /// builtins, and is suitable for passing to \see
947  /// Intrinsic::getIntrinsicForGCCBuiltin().
948  ///
949  /// \return - The architecture prefix, or 0 if none is defined.
951 
952  /// getVendorTypeName - Get the canonical name for the \p Kind vendor.
954 
955  /// getOSTypeName - Get the canonical name for the \p Kind operating system.
957 
958  /// getEnvironmentTypeName - Get the canonical name for the \p Kind
959  /// environment.
961 
962  /// @}
963  /// @name Static helpers for converting alternate architecture names.
964  /// @{
965 
966  /// getArchTypeForLLVMName - The canonical type for the given LLVM
967  /// architecture name (e.g., "x86").
969 
970  /// @}
971 
972  /// Returns a canonicalized OS version number for the specified OS.
974  const VersionTuple &Version);
975 };
976 
977 } // End llvm namespace
978 
979 
980 #endif
llvm::Triple::setEnvironment
void setEnvironment(EnvironmentType Kind)
setEnvironment - Set the environment (fourth) component of the triple to a known type.
Definition: Triple.cpp:1220
llvm::Triple::isMacOSXVersionLT
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
Definition: Triple.cpp:1654
llvm::Triple::setVendorName
void setVendorName(StringRef Str)
setVendorName - Set the vendor (second) component of the triple by name.
Definition: Triple.cpp:1247
llvm::Triple::riscv64
@ riscv64
Definition: Triple.h:74
llvm::Triple::Wasm
@ Wasm
Definition: Triple.h:238
llvm::Triple::getARMCPUForArch
StringRef getARMCPUForArch(StringRef Arch=StringRef()) const
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
Definition: Triple.cpp:1703
llvm::Triple::spir64
@ spir64
Definition: Triple.h:95
llvm::Triple::setTriple
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
Definition: Triple.cpp:1204
llvm::Triple::Mesa
@ Mesa
Definition: Triple.h:159
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::Triple::getOSVersion
void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getOSVersion - Parse the version number from the OS name component of the triple, if present.
Definition: Triple.cpp:1094
llvm::Triple::GNUILP32
@ GNUILP32
Definition: Triple.h:213
llvm::Triple::bpfeb
@ bpfeb
Definition: Triple.h:58
llvm::Triple::Lv2
@ Lv2
Definition: Triple.h:176
llvm::Triple::isMIPS32
bool isMIPS32() const
Tests whether the target is MIPS 32-bit (little and big endian).
Definition: Triple.h:742
llvm::Triple::UnknownArch
@ UnknownArch
Definition: Triple.h:48
llvm::Triple::hsail
@ hsail
Definition: Triple.h:92
llvm::Triple::isPS4
bool isPS4() const
Tests whether the target is the PS4 platform.
Definition: Triple.h:667
llvm::Triple::HermitCore
@ HermitCore
Definition: Triple.h:198
llvm::Triple::isOSBinFormatCOFF
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition: Triple.h:637
llvm::Triple::wasm32
@ wasm32
Definition: Triple.h:99
llvm::Triple::CUDA
@ CUDA
Definition: Triple.h:188
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:169
llvm::Triple::KalimbaSubArch_v3
@ KalimbaSubArch_v3
Definition: Triple.h:137
llvm::Triple::getiOSVersion
void getiOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getiOSVersion - Parse the version number as with getOSVersion.
Definition: Triple.cpp:1154
llvm::Triple::EnvironmentType
EnvironmentType
Definition: Triple.h:204
llvm::Triple::ARMSubArch_v8m_mainline
@ ARMSubArch_v8m_mainline
Definition: Triple.h:119
llvm::Triple::x86
@ x86
Definition: Triple.h:83
llvm::Triple::isGNUEnvironment
bool isGNUEnvironment() const
Definition: Triple.h:530
llvm::Triple::SubArchType
SubArchType
Definition: Triple.h:106
llvm::Triple::getOSMajorVersion
unsigned getOSMajorVersion() const
getOSMajorVersion - Return just the major version number, this is specialized because it is a common ...
Definition: Triple.h:349
llvm::Triple::amdgcn
@ amdgcn
Definition: Triple.h:72
llvm::Triple::Simulator
@ Simulator
Definition: Triple.h:227
llvm::Triple::amdil
@ amdil
Definition: Triple.h:90
llvm::Triple::MuslEABIHF
@ MuslEABIHF
Definition: Triple.h:220
llvm::Triple::kalimba
@ kalimba
Definition: Triple.h:96
llvm::Triple::getArchTypeForLLVMName
static ArchType getArchTypeForLLVMName(StringRef Str)
getArchTypeForLLVMName - The canonical type for the given LLVM architecture name (e....
Definition: Triple.cpp:275
llvm::Triple::get32BitArchVariant
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
Definition: Triple.cpp:1348
llvm::Triple::IOS
@ IOS
Definition: Triple.h:173
llvm::Triple::isRISCV
bool isRISCV() const
Tests whether the target is RISC-V (32- and 64-bit).
Definition: Triple.h:773
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::Triple::renderscript32
@ renderscript32
Definition: Triple.h:101
llvm::Triple::getOSAndEnvironmentName
StringRef getOSAndEnvironmentName() const
getOSAndEnvironmentName - Get the operating system and optional environment components as a single st...
Definition: Triple.cpp:1044
llvm::Triple::Minix
@ Minix
Definition: Triple.h:184
llvm::Triple::KalimbaSubArch_v5
@ KalimbaSubArch_v5
Definition: Triple.h:139
llvm::Triple::isWindowsItaniumEnvironment
bool isWindowsItaniumEnvironment() const
Definition: Triple.h:566
llvm::Triple::x86_64
@ x86_64
Definition: Triple.h:84
llvm::Triple::getMacOSXVersion
bool getMacOSXVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getMacOSXVersion - Parse the version number as with getOSVersion and then translate generic "darwin" ...
Definition: Triple.cpp:1107
llvm::Triple::CSR
@ CSR
Definition: Triple.h:156
llvm::Triple::isTvOS
bool isTvOS() const
Is this an Apple tvOS triple.
Definition: Triple.h:468
llvm::Triple::OpenBSD
@ OpenBSD
Definition: Triple.h:179
llvm::Triple::Ananas
@ Ananas
Definition: Triple.h:167
llvm::Triple::getMinimumSupportedOSVersion
VersionTuple getMinimumSupportedOSVersion() const
Some platforms have different minimum supported OS versions that varies by the architecture specified...
Definition: Triple.cpp:1671
llvm::Triple::ppc
@ ppc
Definition: Triple.h:67
llvm::Triple::isOSBinFormatXCOFF
bool isOSBinFormatXCOFF() const
Tests whether the OS uses the XCOFF binary format.
Definition: Triple.h:655
llvm::Triple::nvptx
@ nvptx
Definition: Triple.h:86
llvm::Triple::hexagon
@ hexagon
Definition: Triple.h:60
llvm::Triple::XCOFF
@ XCOFF
Definition: Triple.h:239
llvm::Triple::isOSLinux
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:595
llvm::Triple::hasDefaultDataSections
bool hasDefaultDataSections() const
Tests whether the target uses -data-sections as default.
Definition: Triple.h:825
llvm::Triple::hasDefaultEmulatedTLS
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
Definition: Triple.h:820
llvm::Triple::isNVPTX
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
Definition: Triple.h:702
llvm::Triple::KalimbaSubArch_v4
@ KalimbaSubArch_v4
Definition: Triple.h:138
llvm::Triple::isAMDGPU
bool isAMDGPU() const
Definition: Triple.h:709
llvm::Triple::merge
std::string merge(const Triple &Other) const
Merge target triples.
Definition: Triple.cpp:1645
llvm::Triple::NVIDIA
@ NVIDIA
Definition: Triple.h:155
llvm::Triple::LastVendorType
@ LastVendorType
Definition: Triple.h:162
llvm::Triple::avr
@ avr
Definition: Triple.h:56
llvm::Triple::isOSContiki
bool isOSContiki() const
Definition: Triple.h:537
llvm::Triple::aarch64_32
@ aarch64_32
Definition: Triple.h:54
llvm::Triple::isPS4CPU
bool isPS4CPU() const
Tests whether the target is the PS4 CPU.
Definition: Triple.h:660
llvm::Triple::isOSEmscripten
bool isOSEmscripten() const
Tests whether the OS is Emscripten.
Definition: Triple.h:615
llvm::Triple::le32
@ le32
Definition: Triple.h:88
llvm::Triple::isOSBinFormatWasm
bool isOSBinFormatWasm() const
Tests whether the OS uses the Wasm binary format.
Definition: Triple.h:650
llvm::Triple::mips64
@ mips64
Definition: Triple.h:64
llvm::Triple::DragonFly
@ DragonFly
Definition: Triple.h:170
llvm::Data
@ Data
Definition: SIMachineScheduler.h:56
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:194
llvm::Triple::GNUEABI
@ GNUEABI
Definition: Triple.h:210
llvm::Triple::ARMSubArch_v8m_baseline
@ ARMSubArch_v8m_baseline
Definition: Triple.h:118
llvm::Triple::getCanonicalVersionForOS
static VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version)
Returns a canonicalized OS version number for the specified OS.
Definition: Triple.cpp:1770
llvm::Triple::setOSAndEnvironmentName
void setOSAndEnvironmentName(StringRef Str)
setOSAndEnvironmentName - Set the operating system and optional environment components with a single ...
Definition: Triple.cpp:1264
llvm::Triple::isWindowsMSVCEnvironment
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Definition: Triple.h:557
llvm::Triple::isArch64Bit
bool isArch64Bit() const
Test whether the architecture is 64-bit.
Definition: Triple.cpp:1336
llvm::Triple::GNU
@ GNU
Definition: Triple.h:207
llvm::Triple::ARMSubArch_v8_1m_mainline
@ ARMSubArch_v8_1m_mainline
Definition: Triple.h:120
llvm::Triple::isMacOSX
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Definition: Triple.h:454
llvm::Triple::hsail64
@ hsail64
Definition: Triple.h:93
llvm::Triple::isCompatibleWith
bool isCompatibleWith(const Triple &Other) const
Test whether target triples are compatible.
Definition: Triple.cpp:1621
llvm::Triple::isLittleEndian
bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition: Triple.cpp:1574
llvm::Triple::isOSUnknown
bool isOSUnknown() const
Definition: Triple.h:528
llvm::Triple::isAndroid
bool isAndroid() const
Tests whether the target is Android.
Definition: Triple.h:673
llvm::Triple::sparc
@ sparc
Definition: Triple.h:75
llvm::Triple::Musl
@ Musl
Definition: Triple.h:218
llvm::Triple::isOSBinFormatELF
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:632
llvm::Triple::FreeBSD
@ FreeBSD
Definition: Triple.h:171
llvm::Triple::sparcv9
@ sparcv9
Definition: Triple.h:76
llvm::Triple::sparcel
@ sparcel
Definition: Triple.h:77
llvm::Triple::get64BitArchVariant
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
Definition: Triple.cpp:1416
llvm::Triple::ARMSubArch_v8_2a
@ ARMSubArch_v8_2a
Definition: Triple.h:114
llvm::Triple::ArchType
ArchType
Definition: Triple.h:47
llvm::Triple::ARMSubArch_v5
@ ARMSubArch_v5
Definition: Triple.h:131
llvm::Triple::GNUABI64
@ GNUABI64
Definition: Triple.h:209
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:193
llvm::Triple::str
const std::string & str() const
Definition: Triple.h:376
llvm::Triple::isOSDarwin
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
Definition: Triple.h:484
llvm::Triple::ARMSubArch_v8_4a
@ ARMSubArch_v8_4a
Definition: Triple.h:112
llvm::Triple::Cygnus
@ Cygnus
Definition: Triple.h:225
llvm::Triple::ARMSubArch_v8r
@ ARMSubArch_v8r
Definition: Triple.h:117
llvm::Triple::Mesa3D
@ Mesa3D
Definition: Triple.h:195
llvm::Triple::mips64el
@ mips64el
Definition: Triple.h:65
llvm::Triple::PC
@ PC
Definition: Triple.h:149
Twine.h
llvm::Triple::isAArch64
bool isAArch64() const
Tests whether the target is AArch64 (little and big endian).
Definition: Triple.h:724
llvm::Triple::CODE16
@ CODE16
Definition: Triple.h:214
llvm::Triple::nvptx64
@ nvptx64
Definition: Triple.h:87
llvm::Triple::PS4
@ PS4
Definition: Triple.h:191
llvm::Triple::isTargetMachineMac
bool isTargetMachineMac() const
Returns true for targets that run on a macOS machine.
Definition: Triple.h:497
llvm::Triple::OpenEmbedded
@ OpenEmbedded
Definition: Triple.h:161
llvm::Triple::le64
@ le64
Definition: Triple.h:89
llvm::Triple::Emscripten
@ Emscripten
Definition: Triple.h:201
llvm::Triple::Haiku
@ Haiku
Definition: Triple.h:183
llvm::Triple::isVE
bool isVE() const
Tests whether the target is VE.
Definition: Triple.h:788
llvm::Triple::MipsSubArch_r6
@ MipsSubArch_r6
Definition: Triple.h:141
llvm::Triple::Freescale
@ Freescale
Definition: Triple.h:151
llvm::Triple::supportsCOMDAT
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition: Triple.h:815
llvm::Triple::ppc64
@ ppc64
Definition: Triple.h:69
llvm::Triple::NaCl
@ NaCl
Definition: Triple.h:186
llvm::Triple::NetBSD
@ NetBSD
Definition: Triple.h:178
llvm::Triple::isOSBinFormatMachO
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition: Triple.h:645
llvm::Triple::xcore
@ xcore
Definition: Triple.h:85
llvm::Triple::setVendor
void setVendor(VendorType Kind)
setVendor - Set the vendor (second) component of the triple to a known type.
Definition: Triple.cpp:1212
llvm::Triple::setEnvironmentName
void setEnvironmentName(StringRef Str)
setEnvironmentName - Set the optional environment (fourth) component of the triple by name.
Definition: Triple.cpp:1259
llvm::Triple::r600
@ r600
Definition: Triple.h:71
llvm::Triple::Win32
@ Win32
Definition: Triple.h:181
llvm::Triple::isOSIAMCU
bool isOSIAMCU() const
Definition: Triple.h:524
llvm::Triple::getObjectFormat
ObjectFormatType getObjectFormat() const
getFormat - Get the object format for this triple.
Definition: Triple.h:337
llvm::Triple::KFreeBSD
@ KFreeBSD
Definition: Triple.h:174
llvm::Triple::isOSzOS
bool isOSzOS() const
Definition: Triple.h:481
llvm::Triple::RTEMS
@ RTEMS
Definition: Triple.h:185
llvm::Triple::m68k
@ m68k
Definition: Triple.h:61
llvm::Triple::isCSKY
bool isCSKY() const
Definition: Triple.h:798
llvm::Triple::UnknownEnvironment
@ UnknownEnvironment
Definition: Triple.h:205
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:28
llvm::IndexedInstrProf::Version
const uint64_t Version
Definition: InstrProf.h:991
llvm::Triple::LastEnvironmentType
@ LastEnvironmentType
Definition: Triple.h:229
llvm::Triple::getArchName
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
Definition: Triple.cpp:1023
llvm::Triple::isPPC32
bool isPPC32() const
Tests whether the target is 32-bit PowerPC (little and big endian).
Definition: Triple.h:763
llvm::Triple::isOSBinFormatGOFF
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
Definition: Triple.h:642
llvm::Triple::lanai
@ lanai
Definition: Triple.h:98
llvm::Triple::MuslEABI
@ MuslEABI
Definition: Triple.h:219
llvm::Triple::getEnvironmentTypeName
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
getEnvironmentTypeName - Get the canonical name for the Kind environment.
Definition: Triple.cpp:231
llvm::Triple::isOSAIX
bool isOSAIX() const
Tests whether the OS is AIX.
Definition: Triple.h:627
llvm::Triple::getArch
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:307
llvm::Triple::GOFF
@ GOFF
Definition: Triple.h:236
llvm::Triple::getTriple
const std::string & getTriple() const
Definition: Triple.h:378
llvm::Triple::ARMSubArch_v8_5a
@ ARMSubArch_v8_5a
Definition: Triple.h:111
llvm::Triple::ARMSubArch_v7s
@ ARMSubArch_v7s
Definition: Triple.h:124
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::Triple::isOSNaCl
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
Definition: Triple.h:590
llvm::Triple::csky
@ csky
Definition: Triple.h:59
llvm::Triple::CoreCLR
@ CoreCLR
Definition: Triple.h:226
llvm::Triple::isOSMSVCRT
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
Definition: Triple.h:584
llvm::Triple::hasDLLImportExport
bool hasDLLImportExport() const
Tests if the environment supports dllimport/export annotations.
Definition: Triple.h:830
llvm::Triple::renderscript64
@ renderscript64
Definition: Triple.h:102
llvm::Triple::ARMSubArch_v6k
@ ARMSubArch_v6k
Definition: Triple.h:129
llvm::Triple::isOSVersionLT
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isOSVersionLT - Helper function for doing comparisons against version numbers included in the target ...
Definition: Triple.h:425
llvm::Triple::MuslX32
@ MuslX32
Definition: Triple.h:221
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:731
llvm::Triple::isOSFuchsia
bool isOSFuchsia() const
Definition: Triple.h:514
llvm::Triple::AMDHSA
@ AMDHSA
Definition: Triple.h:190
llvm::Triple::AArch64SubArch_arm64e
@ AArch64SubArch_arm64e
Definition: Triple.h:135
llvm::Triple::ppc64le
@ ppc64le
Definition: Triple.h:70
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:177
llvm::Triple::isOSHaiku
bool isOSHaiku() const
Tests whether the OS is Haiku.
Definition: Triple.h:542
llvm::Triple::isOSSolaris
bool isOSSolaris() const
Definition: Triple.h:520
llvm::Triple::getEnvironmentVersion
void getEnvironmentVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
Parse the version number from the OS name component of the triple, if present.
Definition: Triple.cpp:1084
llvm::Triple::isThumb
bool isThumb() const
Tests whether the target is Thumb (little and big endian).
Definition: Triple.h:714
llvm::Triple::ELF
@ ELF
Definition: Triple.h:235
llvm::Triple::isOSDragonFly
bool isOSDragonFly() const
Definition: Triple.h:518
llvm::Triple::GNUX32
@ GNUX32
Definition: Triple.h:212
llvm::Triple::isARM
bool isARM() const
Tests whether the target is ARM (little and big endian).
Definition: Triple.h:719
llvm::Triple::isOSCygMing
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Definition: Triple.h:579
llvm::Triple::ARMSubArch_v7ve
@ ARMSubArch_v7ve
Definition: Triple.h:126
llvm::Triple::isArch16Bit
bool isArch16Bit() const
Test whether the architecture is 16-bit.
Definition: Triple.cpp:1344
llvm::Triple::isMIPS64
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
Definition: Triple.h:747
llvm::Triple::Android
@ Android
Definition: Triple.h:217
llvm::Triple::Hurd
@ Hurd
Definition: Triple.h:199
llvm::Triple::getOS
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Definition: Triple.h:316
llvm::Triple::arc
@ arc
Definition: Triple.h:55
llvm::Triple::isOSFreeBSD
bool isOSFreeBSD() const
Definition: Triple.h:510
llvm::Triple::normalize
std::string normalize() const
Return the normalized form of this triple's string.
Definition: Triple.h:300
llvm::Triple::isSPIR
bool isSPIR() const
Tests whether the target is SPIR (32- or 64-bit).
Definition: Triple.h:697
llvm::Triple::isArch32Bit
bool isArch32Bit() const
Test whether the architecture is 32-bit.
Definition: Triple.cpp:1340
llvm::Triple::MSVC
@ MSVC
Definition: Triple.h:223
llvm::Triple::IBM
@ IBM
Definition: Triple.h:152
llvm::Triple::ARMSubArch_v7k
@ ARMSubArch_v7k
Definition: Triple.h:125
llvm::Triple::NVCL
@ NVCL
Definition: Triple.h:189
llvm::Triple::Linux
@ Linux
Definition: Triple.h:175
llvm::Triple::Solaris
@ Solaris
Definition: Triple.h:180
llvm::Triple::getVendorName
StringRef getVendorName() const
getVendorName - Get the vendor (second) component of the triple.
Definition: Triple.cpp:1027
llvm::Triple::isOSOpenBSD
bool isOSOpenBSD() const
Definition: Triple.h:506
llvm::Triple::ARMSubArch_v7m
@ ARMSubArch_v7m
Definition: Triple.h:123
llvm::Triple::isOSGlibc
bool isOSGlibc() const
Tests whether the OS uses glibc.
Definition: Triple.h:620
llvm::Triple::ARMSubArch_v4t
@ ARMSubArch_v4t
Definition: Triple.h:133
llvm::Triple::isWatchABI
bool isWatchABI() const
Definition: Triple.h:477
llvm::Triple::isSimulatorEnvironment
bool isSimulatorEnvironment() const
Definition: Triple.h:488
llvm::Triple::ImaginationTechnologies
@ ImaginationTechnologies
Definition: Triple.h:153
llvm::Triple::isOSHurd
bool isOSHurd() const
Tests whether the OS is Hurd.
Definition: Triple.h:605
llvm::Triple::ARMSubArch_v8
@ ARMSubArch_v8
Definition: Triple.h:116
llvm::Triple::isWindowsCoreCLREnvironment
bool isWindowsCoreCLREnvironment() const
Definition: Triple.h:562
llvm::Triple::ARMSubArch_v6m
@ ARMSubArch_v6m
Definition: Triple.h:128
llvm::Triple::isAMDGCN
bool isAMDGCN() const
Tests whether the target is AMDGCN.
Definition: Triple.h:707
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::Triple::operator!=
bool operator!=(const Triple &Other) const
Definition: Triple.h:285
llvm::Triple::ZOS
@ ZOS
Definition: Triple.h:182
llvm::Triple::bpfel
@ bpfel
Definition: Triple.h:57
llvm::Triple::AMD
@ AMD
Definition: Triple.h:158
llvm::Triple::ARMSubArch_v5te
@ ARMSubArch_v5te
Definition: Triple.h:132
llvm::Triple::SCEI
@ SCEI
Definition: Triple.h:150
llvm::Triple::armeb
@ armeb
Definition: Triple.h:51
llvm::Triple::GNUABIN32
@ GNUABIN32
Definition: Triple.h:208
llvm::Triple::isPPC
bool isPPC() const
Tests whether the target is PowerPC (32- or 64-bit LE or BE).
Definition: Triple.h:757
llvm::Triple::arm
@ arm
Definition: Triple.h:50
llvm::Triple::isMusl
bool isMusl() const
Tests whether the environment is musl-libc.
Definition: Triple.h:689
llvm::Triple::aarch64_be
@ aarch64_be
Definition: Triple.h:53
llvm::Triple::msp430
@ msp430
Definition: Triple.h:66
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::Triple::setArch
void setArch(ArchType Kind)
setArch - Set the architecture (first) component of the triple to a known type.
Definition: Triple.cpp:1208
llvm::Triple::ppcle
@ ppcle
Definition: Triple.h:68
llvm::Triple::ARMSubArch_v8_7a
@ ARMSubArch_v8_7a
Definition: Triple.h:109
llvm::Triple::ARMSubArch_v8_3a
@ ARMSubArch_v8_3a
Definition: Triple.h:113
llvm::Triple::thumb
@ thumb
Definition: Triple.h:81
llvm::Triple::isX86
bool isX86() const
Tests whether the target is x86 (32- or 64-bit).
Definition: Triple.h:783
llvm::Triple::isiOS
bool isiOS() const
Is this an iOS triple.
Definition: Triple.h:463
llvm::Triple::UnknownVendor
@ UnknownVendor
Definition: Triple.h:146
llvm::Triple::ve
@ ve
Definition: Triple.h:103
llvm::Triple::ObjectFormatType
ObjectFormatType
Definition: Triple.h:231
llvm::Triple::isWatchOS
bool isWatchOS() const
Is this an Apple watchOS triple.
Definition: Triple.h:473
llvm::Triple::ARMSubArch_v7
@ ARMSubArch_v7
Definition: Triple.h:121
llvm::Triple::isOSWindows
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:547
llvm::Triple::amdil64
@ amdil64
Definition: Triple.h:91
llvm::Triple::setOS
void setOS(OSType Kind)
setOS - Set the operating system (third) component of the triple to a known type.
Definition: Triple.cpp:1216
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::Triple::WASI
@ WASI
Definition: Triple.h:200
llvm::Triple::OSType
OSType
Definition: Triple.h:164
llvm::Triple::Itanium
@ Itanium
Definition: Triple.h:224
llvm::Triple::VendorType
VendorType
Definition: Triple.h:145
llvm::Triple::ARMSubArch_v8_6a
@ ARMSubArch_v8_6a
Definition: Triple.h:110
llvm::Triple::getOSName
StringRef getOSName() const
getOSName - Get the operating system (third) component of the triple.
Definition: Triple.cpp:1032
llvm::Triple::ARMSubArch_v6t2
@ ARMSubArch_v6t2
Definition: Triple.h:130
llvm::Triple::MipsTechnologies
@ MipsTechnologies
Definition: Triple.h:154
llvm::Triple::getSubArch
SubArchType getSubArch() const
getSubArch - get the parsed subarchitecture type for this triple.
Definition: Triple.h:310
llvm::Triple::isOSVersionLT
bool isOSVersionLT(const Triple &Other) const
Definition: Triple.h:440
llvm::Triple::Fuchsia
@ Fuchsia
Definition: Triple.h:172
llvm::Triple::riscv32
@ riscv32
Definition: Triple.h:73
llvm::Triple::AMDPAL
@ AMDPAL
Definition: Triple.h:197
llvm::Triple::setOSName
void setOSName(StringRef Str)
setOSName - Set the operating system (third) component of the triple by name.
Definition: Triple.cpp:1251
llvm::Triple::MachO
@ MachO
Definition: Triple.h:237
llvm::Triple::LastArchType
@ LastArchType
Definition: Triple.h:104
llvm::Triple::Contiki
@ Contiki
Definition: Triple.h:196
llvm::Triple::isWindowsGNUEnvironment
bool isWindowsGNUEnvironment() const
Definition: Triple.h:574
llvm::Triple::Triple
Triple()
Default constructor is the same as an empty string and leaves all triple fields unknown.
Definition: Triple.h:269
llvm::Triple::getOSTypeName
static StringRef getOSTypeName(OSType Kind)
getOSTypeName - Get the canonical name for the Kind operating system.
Definition: Triple.cpp:187
llvm::Triple::isArm64e
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
Definition: Triple.h:803
llvm::Triple::mipsel
@ mipsel
Definition: Triple.h:63
llvm::Triple::ELFIAMCU
@ ELFIAMCU
Definition: Triple.h:192
llvm::Triple::operator==
bool operator==(const Triple &Other) const
Definition: Triple.h:278
llvm::Triple::getArchTypePrefix
static StringRef getArchTypePrefix(ArchType Kind)
getArchTypePrefix - Get the "prefix" canonical name for the Kind architecture.
Definition: Triple.cpp:86
llvm::Triple::ARMSubArch_v7em
@ ARMSubArch_v7em
Definition: Triple.h:122
llvm::Triple::shave
@ shave
Definition: Triple.h:97
llvm::Triple::AIX
@ AIX
Definition: Triple.h:187
llvm::Triple::tcele
@ tcele
Definition: Triple.h:80
llvm::Triple::systemz
@ systemz
Definition: Triple.h:78
llvm::Triple::isOSWASI
bool isOSWASI() const
Tests whether the OS is WASI.
Definition: Triple.h:610
llvm::Triple::Myriad
@ Myriad
Definition: Triple.h:157
llvm::Triple::ARMSubArch_v8_1a
@ ARMSubArch_v8_1a
Definition: Triple.h:115
llvm::Triple::isAndroidVersionLT
bool isAndroidVersionLT(unsigned Major) const
Definition: Triple.h:675
llvm::Triple::getVendorTypeName
static StringRef getVendorTypeName(VendorType Kind)
getVendorTypeName - Get the canonical name for the Kind vendor.
Definition: Triple.cpp:164
llvm::Triple::isMacCatalystEnvironment
bool isMacCatalystEnvironment() const
Definition: Triple.h:492
llvm::Triple::COFF
@ COFF
Definition: Triple.h:234
llvm::Triple::spir
@ spir
Definition: Triple.h:94
llvm::Triple::setArchName
void setArchName(StringRef Str)
setArchName - Set the architecture (first) component of the triple by name.
Definition: Triple.cpp:1236
llvm::Triple::hasEnvironment
bool hasEnvironment() const
hasEnvironment - Does this triple have the optional environment (fourth) component?
Definition: Triple.h:320
llvm::Triple::MacABI
@ MacABI
Definition: Triple.h:228
llvm::Triple::isOSNetBSD
bool isOSNetBSD() const
Definition: Triple.h:502
llvm::Triple::thumbeb
@ thumbeb
Definition: Triple.h:82
llvm::Triple::CloudABI
@ CloudABI
Definition: Triple.h:168
llvm::Triple::isX32
bool isX32() const
Tests whether the target is X32.
Definition: Triple.h:809
llvm::Triple::getArchTypeName
static StringRef getArchTypeName(ArchType Kind)
getArchTypeName - Get the canonical name for the Kind architecture.
Definition: Triple.cpp:23
llvm::Triple::ARMSubArch_v6
@ ARMSubArch_v6
Definition: Triple.h:127
llvm::Triple::getEnvironment
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
Definition: Triple.h:325
llvm::Triple::isSystemZ
bool isSystemZ() const
Tests whether the target is SystemZ.
Definition: Triple.h:778
llvm::Triple::isMIPS
bool isMIPS() const
Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
Definition: Triple.h:752
llvm::Triple::EABIHF
@ EABIHF
Definition: Triple.h:216
llvm::Triple::getVendor
VendorType getVendor() const
getVendor - Get the parsed vendor type of this triple.
Definition: Triple.h:313
llvm::Triple::SUSE
@ SUSE
Definition: Triple.h:160
llvm::Triple::GNUEABIHF
@ GNUEABIHF
Definition: Triple.h:211
llvm::Triple::getBigEndianArchVariant
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
Definition: Triple.cpp:1484
llvm::Triple::UnknownOS
@ UnknownOS
Definition: Triple.h:165
llvm::Triple::NoSubArch
@ NoSubArch
Definition: Triple.h:107
llvm::Triple::LastOSType
@ LastOSType
Definition: Triple.h:202
llvm::Triple::isWasm
bool isWasm() const
Tests whether the target is wasm (32- and 64-bit).
Definition: Triple.h:793
llvm::Triple::EABI
@ EABI
Definition: Triple.h:215
llvm::Triple::wasm64
@ wasm64
Definition: Triple.h:100
llvm::Triple::getLittleEndianArchVariant
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
Definition: Triple.cpp:1541
llvm::Triple::isPPC64
bool isPPC64() const
Tests whether the target is 64-bit PowerPC (little and big endian).
Definition: Triple.h:768
llvm::Triple::tce
@ tce
Definition: Triple.h:79
llvm::Triple::getWatchOSVersion
void getWatchOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getWatchOSVersion - Parse the version number as with getOSVersion.
Definition: Triple.cpp:1180
llvm::Triple::isOSKFreeBSD
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
Definition: Triple.h:600
llvm::Triple::mips
@ mips
Definition: Triple.h:62
llvm::Triple::isWindowsCygwinEnvironment
bool isWindowsCygwinEnvironment() const
Definition: Triple.h:570
llvm::Triple::aarch64
@ aarch64
Definition: Triple.h:52
llvm::Triple::setObjectFormat
void setObjectFormat(ObjectFormatType Kind)
setObjectFormat - Set the object file format
Definition: Triple.cpp:1228
llvm::Triple::isKnownWindowsMSVCEnvironment
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
Definition: Triple.h:552
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1172
llvm::Triple::Apple
@ Apple
Definition: Triple.h:148
llvm::Triple::PPCSubArch_spe
@ PPCSubArch_spe
Definition: Triple.h:143
llvm::Triple::UnknownObjectFormat
@ UnknownObjectFormat
Definition: Triple.h:232
llvm::Triple::getEnvironmentName
StringRef getEnvironmentName() const
getEnvironmentName - Get the optional environment (fourth) component of the triple,...
Definition: Triple.cpp:1038