Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/ADT/Triple.h
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | enum EnvironmentType { | ||||
MuslEABI, | MuslEABI, | ||||
MuslEABIHF, | MuslEABIHF, | ||||
MSVC, | MSVC, | ||||
Itanium, | Itanium, | ||||
Cygnus, | Cygnus, | ||||
AMDOpenCL, | AMDOpenCL, | ||||
CoreCLR, | CoreCLR, | ||||
LastEnvironmentType = CoreCLR | AndroidABI32, | ||||
AndroidABI64, | |||||
ABI32, | |||||
ABIN32, | |||||
ABI64, | |||||
GNUABI32, | |||||
GNUABIN32, | |||||
LastEnvironmentType = GNUABIN32 | |||||
}; | }; | ||||
enum ObjectFormatType { | enum ObjectFormatType { | ||||
UnknownObjectFormat, | UnknownObjectFormat, | ||||
COFF, | COFF, | ||||
ELF, | ELF, | ||||
MachO, | MachO, | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
bool isOSIAMCU() const { | bool isOSIAMCU() const { | ||||
return getOS() == Triple::ELFIAMCU; | return getOS() == Triple::ELFIAMCU; | ||||
} | } | ||||
bool isGNUEnvironment() const { | bool isGNUEnvironment() const { | ||||
EnvironmentType Env = getEnvironment(); | EnvironmentType Env = getEnvironment(); | ||||
return Env == Triple::GNU || Env == Triple::GNUABI64 || | return Env == Triple::GNU || Env == Triple::GNUABI32 || | ||||
Env == Triple::GNUABIN32 || Env == Triple::GNUABI64 || | |||||
Env == Triple::GNUEABI || Env == Triple::GNUEABIHF || | Env == Triple::GNUEABI || Env == Triple::GNUEABIHF || | ||||
Env == Triple::GNUX32; | Env == Triple::GNUX32; | ||||
} | } | ||||
/// Checks if the environment could be MSVC. | /// Checks if the environment could be MSVC. | ||||
bool isWindowsMSVCEnvironment() const { | bool isWindowsMSVCEnvironment() const { | ||||
return getOS() == Triple::Win32 && | return getOS() == Triple::Win32 && | ||||
(getEnvironment() == Triple::UnknownEnvironment || | (getEnvironment() == Triple::UnknownEnvironment || | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | public: | ||||
/// Tests whether the target is the PS4 platform | /// Tests whether the target is the PS4 platform | ||||
bool isPS4() const { | bool isPS4() const { | ||||
return getVendor() == Triple::SCEI && | return getVendor() == Triple::SCEI && | ||||
getOS() == Triple::PS4; | getOS() == Triple::PS4; | ||||
} | } | ||||
/// Tests whether the target is Android | /// Tests whether the target is Android | ||||
bool isAndroid() const { return getEnvironment() == Triple::Android; } | bool isAndroid() const { | ||||
EnvironmentType Env = getEnvironment(); | |||||
return Env == Triple::Android || Env == Triple::AndroidABI32 || | |||||
Env == Triple::AndroidABI64; | |||||
} | |||||
/// Tests whether the environment is musl-libc | /// Tests whether the environment is musl-libc | ||||
bool isMusl() const { | bool isMusl() const { | ||||
return getEnvironment() == Triple::Musl || | return getEnvironment() == Triple::Musl || | ||||
getEnvironment() == Triple::MuslEABI || | getEnvironment() == Triple::MuslEABI || | ||||
getEnvironment() == Triple::MuslEABIHF; | getEnvironment() == Triple::MuslEABIHF; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | public: | ||||
/// Form a triple with a little endian variant of the current architecture. | /// Form a triple with a little endian variant of the current architecture. | ||||
/// | /// | ||||
/// This can be used to move across "families" of architectures where useful. | /// This can be used to move across "families" of architectures where useful. | ||||
/// | /// | ||||
/// \returns A new triple with a little endian architecture or an unknown | /// \returns A new triple with a little endian architecture or an unknown | ||||
/// architecture if no such variant can be found. | /// architecture if no such variant can be found. | ||||
llvm::Triple getLittleEndianArchVariant() const; | llvm::Triple getLittleEndianArchVariant() const; | ||||
/// Form a triple with variant of the current architecture and the specified | |||||
/// ABI. | |||||
/// | |||||
/// Generally speaking the target specifies the ABI in the triple if the ABI | |||||
/// has a large effect on the output (e.g. ELFCLASS32/ELFCLASS64, REL/RELA, | |||||
/// different sets of relocs) and/or is not link-compatible with other ABI's. | |||||
/// If the ABI is fairly small in effect (e.g. calling convention) then and/or | |||||
/// is link-compatible with other ABI's then MCTargetOptions is preferable. | |||||
/// | |||||
/// \param ABI The ABI name to use. If it is an empty string then the triple's | |||||
/// default is used. | |||||
/// \returns A new triple with the requested ABI or an unknown architecture | |||||
/// if no such variant can be found. Also, an ABI name that is | |||||
/// consistent with the triple. | |||||
std::pair<llvm::Triple, StringRef> getABIVariant(StringRef ABI) const; | |||||
/// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. | /// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. | ||||
/// | /// | ||||
/// \param Arch the architecture name (e.g., "armv7s"). If it is an empty | /// \param Arch the architecture name (e.g., "armv7s"). If it is an empty | ||||
/// string then the triple's arch name is used. | /// string then the triple's arch name is used. | ||||
StringRef getARMCPUForArch(StringRef Arch = StringRef()) const; | StringRef getARMCPUForArch(StringRef Arch = StringRef()) const; | ||||
/// Tests whether the target triple is little endian. | /// Tests whether the target triple is little endian. | ||||
/// | /// | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |