10 #ifndef LLVM_ADT_TRIPLE_H
11 #define LLVM_ADT_TRIPLE_H
238 Triple() : Data(), Arch(), Vendor(), OS(), Environment(), ObjectFormat() {}
243 const Twine &EnvironmentStr);
246 return Arch == Other.Arch && SubArch == Other.SubArch &&
247 Vendor == Other.Vendor && OS == Other.OS &&
248 Environment == Other.Environment &&
249 ObjectFormat == Other.ObjectFormat;
297 unsigned &Micro)
const;
308 void getOSVersion(
unsigned &Major,
unsigned &Minor,
unsigned &Micro)
const;
313 unsigned Maj,
Min, Micro;
323 unsigned &Micro)
const;
328 unsigned &Micro)
const;
333 unsigned &Micro)
const;
339 const std::string &
str()
const {
return Data; }
389 unsigned Micro = 0)
const {
394 return LHS[0] < Major;
396 return LHS[1] < Minor;
398 return LHS[1] < Micro;
413 unsigned Micro = 0)
const {
421 assert(Major == 10 &&
"Unexpected major version");
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
unsigned getOSMajorVersion() const
getOSMajorVersion - Return just the major version number, this is specialized because it is a common ...
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
static StringRef getVendorTypeName(VendorType Kind)
getVendorTypeName - Get the canonical name for the Kind vendor.
void setVendor(VendorType Kind)
setVendor - Set the vendor (second) component of the triple to a known type.
void getWatchOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getWatchOSVersion - Parse the version number as with getOSVersion.
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
const std::string & str() const
void setOS(OSType Kind)
setOS - Set the operating system (third) component of the triple to a known type. ...
bool isOSDragonFly() const
void setEnvironment(EnvironmentType Kind)
setEnvironment - Set the environment (fourth) component of the triple to a known type.
llvm::Triple getBigEndianArchVariant() const
Form a triple with a big endian variant of the current architecture.
bool supportsCOMDAT() const
Tests wether the target supports comdat.
bool isAndroid() const
Tests whether the target is Android.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static StringRef getArchTypeName(ArchType Kind)
getArchTypeName - Get the canonical name for the Kind architecture.
ObjectFormatType getObjectFormat() const
getFormat - Get the object format for this triple.
void setVendorName(StringRef Str)
setVendorName - Set the vendor (second) component of the triple by name.
Triple()
Default constructor is the same as an empty string and leaves all triple fields unknown.
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
bool isArch64Bit() const
Test whether the architecture is 64-bit.
bool isOSLinux() const
Tests whether the OS is Linux.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
StringRef getOSAndEnvironmentName() const
getOSAndEnvironmentName - Get the operating system and optional environment components as a single st...
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
bool isTvOS() const
Is this an Apple tvOS triple.
static StringRef getOSTypeName(OSType Kind)
getOSTypeName - Get the canonical name for the Kind operating system.
SubArchType getSubArch() const
getSubArch - get the parsed subarchitecture type for this triple.
llvm::Triple get32BitArchVariant() const
Form a triple with a 32-bit variant of the current architecture.
bool isiOS() const
Is this an iOS triple.
StringRef getEnvironmentName() const
getEnvironmentName - Get the optional environment (fourth) component of the triple, or "" if empty.
void setObjectFormat(ObjectFormatType Kind)
setObjectFormat - Set the object file format
bool isWindowsGNUEnvironment() const
void setEnvironmentName(StringRef Str)
setEnvironmentName - Set the optional environment (fourth) component of the triple by name...
const std::string & getTriple() const
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
static StringRef getArchTypePrefix(ArchType Kind)
getArchTypePrefix - Get the "prefix" canonical name for the Kind architecture.
StringRef getARMCPUForArch(StringRef Arch=StringRef()) const
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
bool isWatchOS() const
Is this an Apple watchOS triple.
void setArchName(StringRef Str)
setArchName - Set the architecture (first) component of the triple by name.
std::string normalize() const
Return the normalized form of this triple's string.
void getiOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getiOSVersion - Parse the version number as with getOSVersion.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
bool isWindowsCoreCLREnvironment() const
void setOSName(StringRef Str)
setOSName - Set the operating system (third) component of the triple by name.
Triple - Helper class for working with autoconf configuration names.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
llvm::Triple getLittleEndianArchVariant() const
Form a triple with a little endian variant of the current architecture.
void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getOSVersion - Parse the version number from the OS name component of the triple, if present...
StringRef getOSName() const
getOSName - Get the operating system (third) component of the triple.
static ArchType getArchTypeForLLVMName(StringRef Str)
getArchTypeForLLVMName - The canonical type for the given LLVM architecture name (e.g., "x86").
bool isArch16Bit() const
Test whether the architecture is 16-bit.
bool isGNUEnvironment() const
bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isOSVersionLT - Helper function for doing comparisons against version numbers included in the target ...
bool isLittleEndian() const
Tests whether the target triple is little endian.
bool isNVPTX() const
Tests whether the target is NVPTX (32- or 64-bit).
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
llvm::Triple get64BitArchVariant() const
Form a triple with a 64-bit variant of the current architecture.
void setOSAndEnvironmentName(StringRef Str)
setOSAndEnvironmentName - Set the operating system and optional environment components with a single ...
bool isOSGlibc() const
Tests whether the OS uses glibc.
bool isWindowsCygwinEnvironment() const
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
bool isOSMSVCRT() const
Is this a "Windows" OS targeting a "MSVCRT.dll" environment.
bool getMacOSXVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
getMacOSXVersion - Parse the version number as with getOSVersion and then translate generic "darwin" ...
bool isPS4CPU() const
Tests whether the target is the PS4 CPU.
bool hasEnvironment() const
hasEnvironment - Does this triple have the optional environment (fourth) component?
bool isOSVersionLT(const Triple &Other) const
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool isWindowsItaniumEnvironment() const
VendorType getVendor() const
getVendor - Get the parsed vendor type of this triple.
StringRef - Represent a constant reference to a string, i.e.
bool isMusl() const
Tests whether the environment is musl-libc.
bool isPS4() const
Tests whether the target is the PS4 platform.
bool isArch32Bit() const
Test whether the architecture is 32-bit.
bool operator==(const Triple &Other) const
void getEnvironmentVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const
Parse the version number from the OS name component of the triple, if present.
StringRef getVendorName() const
getVendorName - Get the vendor (second) component of the triple.
void setArch(ArchType Kind)
setArch - Set the architecture (first) component of the triple to a known type.
static StringRef getEnvironmentTypeName(EnvironmentType Kind)
getEnvironmentTypeName - Get the canonical name for the Kind environment.