10 #ifndef LLVM_ADT_TRIPLE_H
11 #define LLVM_ADT_TRIPLE_H
210 Triple() : Data(), Arch(), Vendor(), OS(), Environment(), ObjectFormat() {}
215 const Twine &EnvironmentStr);
218 return Arch == Other.Arch && SubArch == Other.SubArch &&
219 Vendor == Other.Vendor && OS == Other.OS &&
220 Environment == Other.Environment &&
221 ObjectFormat == Other.ObjectFormat;
269 unsigned &Micro)
const;
280 void getOSVersion(
unsigned &Major,
unsigned &Minor,
unsigned &Micro)
const;
285 unsigned Maj, Min, Micro;
295 unsigned &Micro)
const;
300 unsigned &Micro)
const;
306 const std::string &
str()
const {
return Data; }
356 unsigned Micro = 0)
const {
361 return LHS[0] < Major;
363 return LHS[1] < Minor;
365 return LHS[1] < Micro;
380 unsigned Micro = 0)
const {
381 assert(
isMacOSX() &&
"Not an OS X triple!");
388 assert(Major == 10 &&
"Unexpected major version");
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
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.
void setVendor(VendorType Kind)
setVendor - Set the vendor (second) component of the triple to a known type.
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 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...
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
bool isArch64Bit() const
Test whether the architecture is 64-bit.
unsigned isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
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.
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
static const char * getVendorTypeName(VendorType Kind)
getVendorTypeName - Get the canonical name for the Kind vendor.
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
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.
void setOSName(StringRef Str)
setOSName - Set the operating system (third) component of the triple by name.
static const char * getArchTypePrefix(ArchType Kind)
getArchTypePrefix - Get the "prefix" canonical name for the Kind architecture.
Triple - Helper class for working with autoconf configuration names.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
static const char * getEnvironmentTypeName(EnvironmentType Kind)
getEnvironmentTypeName - Get the canonical name for the Kind environment.
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").
static const char * getArchTypeName(ArchType Kind)
getArchTypeName - Get the canonical name for the Kind architecture.
bool isArch16Bit() const
Test whether the architecture is 16-bit.
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 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 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.
const char * getARMCPUForArch(StringRef Arch=StringRef()) const
Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
const ARM::ArchExtKind Kind
bool isKnownWindowsMSVCEnvironment() const
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.
static const char * getOSTypeName(OSType Kind)
getOSTypeName - Get the canonical name for the Kind operating system.
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.