1 //===-- llvm/ADT/Triple.h - Target triple helper class ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_ADT_TRIPLE_H
10 #define LLVM_ADT_TRIPLE_H
12 #include "llvm/ADT/Twine.h"
14 // Some system headers or GCC predefined macros conflict with identifiers in
15 // this file. Undefine them here.
22 /// Triple - Helper class for working with autoconf configuration names. For
23 /// historical reasons, we also call these 'triples' (they used to contain
24 /// exactly three fields).
26 /// Configuration names are strings in the canonical form:
27 /// ARCHITECTURE-VENDOR-OPERATING_SYSTEM
29 /// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT
31 /// This class is used for clients which want to support arbitrary
32 /// configuration names, but also want to implement certain special
33 /// behavior for particular configurations. This class isolates the mapping
34 /// from the components of the configuration name to well known IDs.
36 /// At its core the Triple class is designed to be a wrapper for a triple
37 /// string; the constructor does not change or normalize the triple string.
38 /// Clients that need to handle the non-canonical triples that users often
39 /// specify should use the normalize method.
41 /// See autoconf/config.guess for a glimpse into what configuration names
42 /// look like in practice.
48 arm, // ARM (little endian): arm, armv.*, xscale
49 armeb, // ARM (big endian): armeb
50 aarch64, // AArch64 (little endian): aarch64
51 aarch64_be, // AArch64 (big endian): aarch64_be
52 aarch64_32, // AArch64 (little endian) ILP32: aarch64_32
53 arc, // ARC: Synopsys ARC
54 avr, // AVR: Atmel AVR microcontroller
55 bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
56 bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
57 hexagon, // Hexagon: hexagon
58 mips, // MIPS: mips, mipsallegrex, mipsr6
59 mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
60 mips64, // MIPS64: mips64, mips64r6, mipsn32, mipsn32r6
61 mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
62 msp430, // MSP430: msp430
64 ppc64, // PPC64: powerpc64, ppu
65 ppc64le, // PPC64LE: powerpc64le
66 r600, // R600: AMD GPUs HD2XXX - HD6XXX
67 amdgcn, // AMDGCN: AMD GCN GPUs
68 riscv32, // RISC-V (32-bit): riscv32
69 riscv64, // RISC-V (64-bit): riscv64
70 sparc, // Sparc: sparc
71 sparcv9, // Sparcv9: Sparcv9
72 sparcel, // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant
73 systemz, // SystemZ: s390x
74 tce, // TCE (http://tce.cs.tut.fi/): tce
75 tcele, // TCE little endian (http://tce.cs.tut.fi/): tcele
76 thumb, // Thumb (little endian): thumb, thumbv.*
77 thumbeb, // Thumb (big endian): thumbeb
79 x86_64, // X86-64: amd64, x86_64
80 xcore, // XCore: xcore
81 nvptx, // NVPTX: 32-bit
82 nvptx64, // NVPTX: 64-bit
83 le32, // le32: generic little-endian 32-bit CPU (PNaCl)
84 le64, // le64: generic little-endian 64-bit CPU (PNaCl)
86 amdil64, // AMDIL with 64-bit pointers
88 hsail64, // AMD HSAIL with 64-bit pointers
89 spir, // SPIR: standard portable IR for OpenCL 32-bit version
90 spir64, // SPIR: standard portable IR for OpenCL 64-bit version
91 kalimba, // Kalimba: generic kalimba
92 shave, // SHAVE: Movidius vector VLIW processors
93 lanai, // Lanai: Lanai 32-bit
94 wasm32, // WebAssembly with 32-bit pointers
95 wasm64, // WebAssembly with 64-bit pointers
96 renderscript32, // 32-bit RenderScript
97 renderscript64, // 64-bit RenderScript
98 ve, // NEC SX-Aurora Vector Engine
111 ARMSubArch_v8m_baseline,
112 ARMSubArch_v8m_mainline,
113 ARMSubArch_v8_1m_mainline,
146 ImaginationTechnologies,
155 LastVendorType = OpenEmbedded
178 NaCl, // Native Client
179 CNK, // BG/P Compute-Node Kernel
182 NVCL, // NVIDIA OpenCL
183 AMDHSA, // AMD HSA Runtime
187 WatchOS, // Apple watchOS
190 AMDPAL, // AMD PAL Runtime
191 HermitCore, // HermitCore Unikernel/Multikernel
193 WASI, // Experimental WebAssembly OS
195 LastOSType = Emscripten
197 enum EnvironmentType {
218 Simulator, // Simulator variants of other systems, e.g., Apple's iOS
219 MacABI, // Mac Catalyst variant of Apple's iOS deployment target.
220 LastEnvironmentType = MacABI
222 enum ObjectFormatType {
235 /// The parsed arch type.
238 /// The parsed subarchitecture type.
241 /// The parsed vendor type.
244 /// The parsed OS type.
247 /// The parsed Environment type.
248 EnvironmentType Environment;
250 /// The object format type.
251 ObjectFormatType ObjectFormat;
254 /// @name Constructors
257 /// Default constructor is the same as an empty string and leaves all
258 /// triple fields unknown.
260 : Data(), Arch(), SubArch(), Vendor(), OS(), Environment(),
263 explicit Triple(const Twine &Str);
264 Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr);
265 Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
266 const Twine &EnvironmentStr);
268 bool operator==(const Triple &Other) const {
269 return Arch == Other.Arch && SubArch == Other.SubArch &&
270 Vendor == Other.Vendor && OS == Other.OS &&
271 Environment == Other.Environment &&
272 ObjectFormat == Other.ObjectFormat;
275 bool operator!=(const Triple &Other) const {
276 return !(*this == Other);
280 /// @name Normalization
283 /// normalize - Turn an arbitrary machine specification into the canonical
284 /// triple form (or something sensible that the Triple class understands if
285 /// nothing better can reasonably be done). In particular, it handles the
286 /// common case in which otherwise valid components are in the wrong order.
287 static std::string normalize(StringRef Str);
289 /// Return the normalized form of this triple's string.
290 std::string normalize() const { return normalize(Data); }
293 /// @name Typed Component Access
296 /// getArch - Get the parsed architecture type of this triple.
297 ArchType getArch() const { return Arch; }
299 /// getSubArch - get the parsed subarchitecture type for this triple.
300 SubArchType getSubArch() const { return SubArch; }
302 /// getVendor - Get the parsed vendor type of this triple.
303 VendorType getVendor() const { return Vendor; }
305 /// getOS - Get the parsed operating system type of this triple.
306 OSType getOS() const { return OS; }
308 /// hasEnvironment - Does this triple have the optional environment
309 /// (fourth) component?
310 bool hasEnvironment() const {
311 return getEnvironmentName() != "";
314 /// getEnvironment - Get the parsed environment type of this triple.
315 EnvironmentType getEnvironment() const { return Environment; }
317 /// Parse the version number from the OS name component of the
318 /// triple, if present.
320 /// For example, "fooos1.2.3" would return (1, 2, 3).
322 /// If an entry is not defined, it will be returned as 0.
323 void getEnvironmentVersion(unsigned &Major, unsigned &Minor,
324 unsigned &Micro) const;
326 /// getFormat - Get the object format for this triple.
327 ObjectFormatType getObjectFormat() const { return ObjectFormat; }
329 /// getOSVersion - Parse the version number from the OS name component of the
330 /// triple, if present.
332 /// For example, "fooos1.2.3" would return (1, 2, 3).
334 /// If an entry is not defined, it will be returned as 0.
335 void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const;
337 /// getOSMajorVersion - Return just the major version number, this is
338 /// specialized because it is a common query.
339 unsigned getOSMajorVersion() const {
340 unsigned Maj, Min, Micro;
341 getOSVersion(Maj, Min, Micro);
345 /// getMacOSXVersion - Parse the version number as with getOSVersion and then
346 /// translate generic "darwin" versions to the corresponding OS X versions.
347 /// This may also be called with IOS triples but the OS X version number is
348 /// just set to a constant 10.4.0 in that case. Returns true if successful.
349 bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
350 unsigned &Micro) const;
352 /// getiOSVersion - Parse the version number as with getOSVersion. This should
353 /// only be called with IOS or generic triples.
354 void getiOSVersion(unsigned &Major, unsigned &Minor,
355 unsigned &Micro) const;
357 /// getWatchOSVersion - Parse the version number as with getOSVersion. This
358 /// should only be called with WatchOS or generic triples.
359 void getWatchOSVersion(unsigned &Major, unsigned &Minor,
360 unsigned &Micro) const;
363 /// @name Direct Component Access
366 const std::string &str() const { return Data; }
368 const std::string &getTriple() const { return Data; }
370 /// getArchName - Get the architecture (first) component of the
372 StringRef getArchName() const;
374 /// getVendorName - Get the vendor (second) component of the triple.
375 StringRef getVendorName() const;
377 /// getOSName - Get the operating system (third) component of the
379 StringRef getOSName() const;
381 /// getEnvironmentName - Get the optional environment (fourth)
382 /// component of the triple, or "" if empty.
383 StringRef getEnvironmentName() const;
385 /// getOSAndEnvironmentName - Get the operating system and optional
386 /// environment components as a single string (separated by a '-'
387 /// if the environment component is present).
388 StringRef getOSAndEnvironmentName() const;
391 /// @name Convenience Predicates
394 /// Test whether the architecture is 64-bit
396 /// Note that this tests for 64-bit pointer width, and nothing else. Note
397 /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
398 /// 16-bit. The inner details of pointer width for particular architectures
399 /// is not summed up in the triple, and so only a coarse grained predicate
400 /// system is provided.
401 bool isArch64Bit() const;
403 /// Test whether the architecture is 32-bit
405 /// Note that this tests for 32-bit pointer width, and nothing else.
406 bool isArch32Bit() const;
408 /// Test whether the architecture is 16-bit
410 /// Note that this tests for 16-bit pointer width, and nothing else.
411 bool isArch16Bit() const;
413 /// isOSVersionLT - Helper function for doing comparisons against version
414 /// numbers included in the target triple.
415 bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
416 unsigned Micro = 0) const {
418 getOSVersion(LHS[0], LHS[1], LHS[2]);
421 return LHS[0] < Major;
423 return LHS[1] < Minor;
425 return LHS[2] < Micro;
430 bool isOSVersionLT(const Triple &Other) const {
432 Other.getOSVersion(RHS[0], RHS[1], RHS[2]);
433 return isOSVersionLT(RHS[0], RHS[1], RHS[2]);
436 /// isMacOSXVersionLT - Comparison function for checking OS X version
437 /// compatibility, which handles supporting skewed version numbering schemes
438 /// used by the "darwin" triples.
439 bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
440 unsigned Micro = 0) const {
441 assert(isMacOSX() && "Not an OS X triple!");
443 // If this is OS X, expect a sane version number.
444 if (getOS() == Triple::MacOSX)
445 return isOSVersionLT(Major, Minor, Micro);
447 // Otherwise, compare to the "Darwin" number.
448 assert(Major == 10 && "Unexpected major version");
449 return isOSVersionLT(Minor + 4, Micro, 0);
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;
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.
464 return getOS() == Triple::IOS || isTvOS();
467 /// Is this an Apple tvOS triple.
468 bool isTvOS() const {
469 return getOS() == Triple::TvOS;
472 /// Is this an Apple watchOS triple.
473 bool isWatchOS() const {
474 return getOS() == Triple::WatchOS;
477 bool isWatchABI() const {
478 return getSubArch() == Triple::ARMSubArch_v7k;
481 /// isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
482 bool isOSDarwin() const {
483 return isMacOSX() || isiOS() || isWatchOS();
486 bool isSimulatorEnvironment() const {
487 return getEnvironment() == Triple::Simulator;
490 bool isMacCatalystEnvironment() const {
491 return getEnvironment() == Triple::MacABI;
494 bool isOSNetBSD() const {
495 return getOS() == Triple::NetBSD;
498 bool isOSOpenBSD() const {
499 return getOS() == Triple::OpenBSD;
502 bool isOSFreeBSD() const {
503 return getOS() == Triple::FreeBSD;
506 bool isOSFuchsia() const {
507 return getOS() == Triple::Fuchsia;
510 bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
512 bool isOSSolaris() const {
513 return getOS() == Triple::Solaris;
516 bool isOSIAMCU() const {
517 return getOS() == Triple::ELFIAMCU;
520 bool isOSUnknown() const { return getOS() == Triple::UnknownOS; }
522 bool isGNUEnvironment() const {
523 EnvironmentType Env = getEnvironment();
524 return Env == Triple::GNU || Env == Triple::GNUABIN32 ||
525 Env == Triple::GNUABI64 || Env == Triple::GNUEABI ||
526 Env == Triple::GNUEABIHF || Env == Triple::GNUX32;
529 bool isOSContiki() const {
530 return getOS() == Triple::Contiki;
533 /// Tests whether the OS is Haiku.
534 bool isOSHaiku() const {
535 return getOS() == Triple::Haiku;
538 /// Tests whether the OS is Windows.
539 bool isOSWindows() const {
540 return getOS() == Triple::Win32;
543 /// Checks if the environment is MSVC.
544 bool isKnownWindowsMSVCEnvironment() const {
545 return isOSWindows() && getEnvironment() == Triple::MSVC;
548 /// Checks if the environment could be MSVC.
549 bool isWindowsMSVCEnvironment() const {
550 return isKnownWindowsMSVCEnvironment() ||
551 (isOSWindows() && getEnvironment() == Triple::UnknownEnvironment);
554 bool isWindowsCoreCLREnvironment() const {
555 return isOSWindows() && getEnvironment() == Triple::CoreCLR;
558 bool isWindowsItaniumEnvironment() const {
559 return isOSWindows() && getEnvironment() == Triple::Itanium;
562 bool isWindowsCygwinEnvironment() const {
563 return isOSWindows() && getEnvironment() == Triple::Cygnus;
566 bool isWindowsGNUEnvironment() const {
567 return isOSWindows() && getEnvironment() == Triple::GNU;
570 /// Tests for either Cygwin or MinGW OS
571 bool isOSCygMing() const {
572 return isWindowsCygwinEnvironment() || isWindowsGNUEnvironment();
575 /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
576 bool isOSMSVCRT() const {
577 return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment() ||
578 isWindowsItaniumEnvironment();
581 /// Tests whether the OS is NaCl (Native Client)
582 bool isOSNaCl() const {
583 return getOS() == Triple::NaCl;
586 /// Tests whether the OS is Linux.
587 bool isOSLinux() const {
588 return getOS() == Triple::Linux;
591 /// Tests whether the OS is kFreeBSD.
592 bool isOSKFreeBSD() const {
593 return getOS() == Triple::KFreeBSD;
596 /// Tests whether the OS is Hurd.
597 bool isOSHurd() const {
598 return getOS() == Triple::Hurd;
601 /// Tests whether the OS is WASI.
602 bool isOSWASI() const {
603 return getOS() == Triple::WASI;
606 /// Tests whether the OS is Emscripten.
607 bool isOSEmscripten() const {
608 return getOS() == Triple::Emscripten;
611 /// Tests whether the OS uses glibc.
612 bool isOSGlibc() const {
613 return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
614 getOS() == Triple::Hurd) &&
618 /// Tests whether the OS is AIX.
619 bool isOSAIX() const {
620 return getOS() == Triple::AIX;
623 /// Tests whether the OS uses the ELF binary format.
624 bool isOSBinFormatELF() const {
625 return getObjectFormat() == Triple::ELF;
628 /// Tests whether the OS uses the COFF binary format.
629 bool isOSBinFormatCOFF() const {
630 return getObjectFormat() == Triple::COFF;
633 /// Tests whether the environment is MachO.
634 bool isOSBinFormatMachO() const {
635 return getObjectFormat() == Triple::MachO;
638 /// Tests whether the OS uses the Wasm binary format.
639 bool isOSBinFormatWasm() const {
640 return getObjectFormat() == Triple::Wasm;
643 /// Tests whether the OS uses the XCOFF binary format.
644 bool isOSBinFormatXCOFF() const {
645 return getObjectFormat() == Triple::XCOFF;
648 /// Tests whether the target is the PS4 CPU
649 bool isPS4CPU() const {
650 return getArch() == Triple::x86_64 &&
651 getVendor() == Triple::SCEI &&
652 getOS() == Triple::PS4;
655 /// Tests whether the target is the PS4 platform
657 return getVendor() == Triple::SCEI &&
658 getOS() == Triple::PS4;
661 /// Tests whether the target is Android
662 bool isAndroid() const { return getEnvironment() == Triple::Android; }
664 bool isAndroidVersionLT(unsigned Major) const {
665 assert(isAndroid() && "Not an Android triple!");
668 getEnvironmentVersion(Env[0], Env[1], Env[2]);
670 // 64-bit targets did not exist before API level 21 (Lollipop).
671 if (isArch64Bit() && Env[0] < 21)
674 return Env[0] < Major;
677 /// Tests whether the environment is musl-libc
678 bool isMusl() const {
679 return getEnvironment() == Triple::Musl ||
680 getEnvironment() == Triple::MuslEABI ||
681 getEnvironment() == Triple::MuslEABIHF;
684 /// Tests whether the target is SPIR (32- or 64-bit).
685 bool isSPIR() const {
686 return getArch() == Triple::spir || getArch() == Triple::spir64;
689 /// Tests whether the target is NVPTX (32- or 64-bit).
690 bool isNVPTX() const {
691 return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
694 /// Tests whether the target is Thumb (little and big endian).
695 bool isThumb() const {
696 return getArch() == Triple::thumb || getArch() == Triple::thumbeb;
699 /// Tests whether the target is ARM (little and big endian).
701 return getArch() == Triple::arm || getArch() == Triple::armeb;
704 /// Tests whether the target is AArch64 (little and big endian).
705 bool isAArch64() const {
706 return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be;
709 /// Tests whether the target is MIPS 32-bit (little and big endian).
710 bool isMIPS32() const {
711 return getArch() == Triple::mips || getArch() == Triple::mipsel;
714 /// Tests whether the target is MIPS 64-bit (little and big endian).
715 bool isMIPS64() const {
716 return getArch() == Triple::mips64 || getArch() == Triple::mips64el;
719 /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit).
720 bool isMIPS() const {
721 return isMIPS32() || isMIPS64();
724 /// Tests whether the target is 64-bit PowerPC (little and big endian).
725 bool isPPC64() const {
726 return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le;
729 /// Tests whether the target is RISC-V (32- and 64-bit).
730 bool isRISCV() const {
731 return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
734 /// Tests whether the target is x86 (32- or 64-bit).
736 return getArch() == Triple::x86 || getArch() == Triple::x86_64;
739 /// Tests whether the target is VE
741 return getArch() == Triple::ve;
744 /// Tests whether the target supports comdat
745 bool supportsCOMDAT() const {
746 return !isOSBinFormatMachO();
749 /// Tests whether the target uses emulated TLS as default.
750 bool hasDefaultEmulatedTLS() const {
751 return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment();
758 /// setArch - Set the architecture (first) component of the triple
760 void setArch(ArchType Kind);
762 /// setVendor - Set the vendor (second) component of the triple to a
764 void setVendor(VendorType Kind);
766 /// setOS - Set the operating system (third) component of the triple
768 void setOS(OSType Kind);
770 /// setEnvironment - Set the environment (fourth) component of the triple
772 void setEnvironment(EnvironmentType Kind);
774 /// setObjectFormat - Set the object file format
775 void setObjectFormat(ObjectFormatType Kind);
777 /// setTriple - Set all components to the new triple \p Str.
778 void setTriple(const Twine &Str);
780 /// setArchName - Set the architecture (first) component of the
782 void setArchName(StringRef Str);
784 /// setVendorName - Set the vendor (second) component of the triple
786 void setVendorName(StringRef Str);
788 /// setOSName - Set the operating system (third) component of the
790 void setOSName(StringRef Str);
792 /// setEnvironmentName - Set the optional environment (fourth)
793 /// component of the triple by name.
794 void setEnvironmentName(StringRef Str);
796 /// setOSAndEnvironmentName - Set the operating system and optional
797 /// environment components with a single string.
798 void setOSAndEnvironmentName(StringRef Str);
801 /// @name Helpers to build variants of a particular triple.
804 /// Form a triple with a 32-bit variant of the current architecture.
806 /// This can be used to move across "families" of architectures where useful.
808 /// \returns A new triple with a 32-bit architecture or an unknown
809 /// architecture if no such variant can be found.
810 llvm::Triple get32BitArchVariant() const;
812 /// Form a triple with a 64-bit variant of the current architecture.
814 /// This can be used to move across "families" of architectures where useful.
816 /// \returns A new triple with a 64-bit architecture or an unknown
817 /// architecture if no such variant can be found.
818 llvm::Triple get64BitArchVariant() const;
820 /// Form a triple with a big endian variant of the current architecture.
822 /// This can be used to move across "families" of architectures where useful.
824 /// \returns A new triple with a big endian architecture or an unknown
825 /// architecture if no such variant can be found.
826 llvm::Triple getBigEndianArchVariant() const;
828 /// Form a triple with a little endian variant of the current architecture.
830 /// This can be used to move across "families" of architectures where useful.
832 /// \returns A new triple with a little endian architecture or an unknown
833 /// architecture if no such variant can be found.
834 llvm::Triple getLittleEndianArchVariant() const;
836 /// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
838 /// \param Arch the architecture name (e.g., "armv7s"). If it is an empty
839 /// string then the triple's arch name is used.
840 StringRef getARMCPUForArch(StringRef Arch = StringRef()) const;
842 /// Tests whether the target triple is little endian.
844 /// \returns true if the triple is little endian, false otherwise.
845 bool isLittleEndian() const;
847 /// Test whether target triples are compatible.
848 bool isCompatibleWith(const Triple &Other) const;
850 /// Merge target triples.
851 std::string merge(const Triple &Other) const;
854 /// @name Static helpers for IDs.
857 /// getArchTypeName - Get the canonical name for the \p Kind architecture.
858 static StringRef getArchTypeName(ArchType Kind);
860 /// getArchTypePrefix - Get the "prefix" canonical name for the \p Kind
861 /// architecture. This is the prefix used by the architecture specific
862 /// builtins, and is suitable for passing to \see
863 /// Intrinsic::getIntrinsicForGCCBuiltin().
865 /// \return - The architecture prefix, or 0 if none is defined.
866 static StringRef getArchTypePrefix(ArchType Kind);
868 /// getVendorTypeName - Get the canonical name for the \p Kind vendor.
869 static StringRef getVendorTypeName(VendorType Kind);
871 /// getOSTypeName - Get the canonical name for the \p Kind operating system.
872 static StringRef getOSTypeName(OSType Kind);
874 /// getEnvironmentTypeName - Get the canonical name for the \p Kind
876 static StringRef getEnvironmentTypeName(EnvironmentType Kind);
879 /// @name Static helpers for converting alternate architecture names.
882 /// getArchTypeForLLVMName - The canonical type for the given LLVM
883 /// architecture name (e.g., "x86").
884 static ArchType getArchTypeForLLVMName(StringRef Str);
889 } // End llvm namespace