asmjit::Environment Class Reference

Represents an environment, which is usually related to a Target.

Environment has usually an 'arch-subarch-vendor-os-abi' format, which is sometimes called "Triple" (historically it used to be 3 only parts) or "Tuple", which is a convention used by Debian Linux.

AsmJit doesn't support all possible combinations or architectures and ABIs, however, it models the environment similarly to other compilers for future extensibility.

Public Members

Members

Member Functions

Overloaded Operators
Accessors

Static Functions

Static Utilities

Construction & Destruction

Member Function Documentation

Environment Environment::host()staticnoexcept

Returns the host environment constructed from preprocessor macros defined by the compiler.

The returned environment should precisely match the target host architecture, sub-architecture, platform, and ABI.

bool Environment::empty() constnoexcept

Tests whether the environment is not set up.

Returns true if all members are zero, and thus unknown.

bool Environment::isInitialized() constnoexcept

Tests whether the environment is initialized, which means it must have a valid architecture.

void Environment::reset()noexcept

Resets all members of the environment to zero / unknown.

Arch Environment::arch() constnoexcept

Returns the architecture.

SubArch Environment::subArch() constnoexcept

Returns the sub-architecture.

Vendor Environment::vendor() constnoexcept

Returns vendor.

Platform Environment::platform() constnoexcept

Returns target's platform or operating system.

PlatformABI Environment::platformABI() constnoexcept

Returns target's ABI.

ObjectFormat Environment::objectFormat() constnoexcept

Returns target's object format.

bool Environment::is32Bit() constnoexcept[1/2]

Tests whether the architecture is 32-bit.

bool Environment::is64Bit() constnoexcept[1/2]

Tests whether the architecture is 64-bit.

bool Environment::isLittleEndian() constnoexcept[1/2]

Tests whether the architecture is little endian.

bool Environment::isBigEndian() constnoexcept[1/2]

Tests whether the architecture is big endian.

bool Environment::isFamilyX86() constnoexcept[1/2]

Tests whether this architecture is of X86 family.

bool Environment::isFamilyARM() constnoexcept[1/2]

Tests whether this architecture family is ARM, THUMB, or AArch64.

bool Environment::isFamilyAArch32() constnoexcept[1/2]

Tests whether this architecture family is AArch32 (ARM or THUMB).

bool Environment::isFamilyAArch64() constnoexcept[1/2]

Tests whether this architecture family is AArch64.

bool Environment::isFamilyMIPS() constnoexcept[1/2]

Tests whether this architecture family is MISP or MIPS64.

bool Environment::isFamilyRISCV() constnoexcept[1/2]

Tests whether this architecture family is RISC-V (both 32-bit and 64-bit).

bool Environment::isPlatformWindows() constnoexcept

Tests whether the environment platform is Windows.

bool Environment::isPlatformLinux() constnoexcept

Tests whether the environment platform is Linux.

bool Environment::isPlatformHurd() constnoexcept

Tests whether the environment platform is Hurd.

bool Environment::isPlatformHaiku() constnoexcept

Tests whether the environment platform is Haiku.

bool Environment::isPlatformBSD() constnoexcept

Tests whether the environment platform is any BSD.

bool Environment::isPlatformApple() constnoexcept

Tests whether the environment platform is any Apple platform (OSX, iOS, TVOS, WatchOS).

bool Environment::isMSVC() constnoexcept

Tests whether the ABI is MSVC.

bool Environment::isGNU() constnoexcept

Tests whether the ABI is GNU.

uint32_t Environment::stackAlignment() constnoexcept

Returns a calculated stack alignment for this environment.

uint32_t Environment::registerSize() constnoexcept

Returns a native register size of this architecture.

void Environment::setArch(Arch arch)noexcept

Sets the architecture to arch.

void Environment::setSubArch(SubArch subArch)noexcept

Sets the sub-architecture to subArch.

void Environment::setVendor(Vendor vendor)noexcept

Sets the vendor to vendor.

void Environment::setPlatform(Platform platform)noexcept

Sets the platform to platform.

void Environment::setPlatformABI(PlatformABI platformABI)noexcept

Sets the ABI to platformABI.

void Environment::setObjectFormat(ObjectFormat objectFormat)noexcept

Sets the object format to objectFormat.

bool Environment::is32Bit(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture arch is 32-bit.

bool Environment::is64Bit(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture arch is 64-bit.

bool Environment::isLittleEndian(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture arch is little endian.

bool Environment::isBigEndian(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture arch is big endian.

bool Environment::isArchThumb(Arch arch)staticnoexcept

Tests whether the given architecture is Thumb or Thumb_BE.

bool Environment::isArchARM(Arch arch)staticnoexcept

Tests whether the given architecture is ARM or ARM_BE.

bool Environment::isArchAArch64(Arch arch)staticnoexcept

Tests whether the given architecture is AArch64 or AArch64_BE.

bool Environment::isArchMIPS32(Arch arch)staticnoexcept

Tests whether the given architecture is MIPS32_LE or MIPS32_BE.

bool Environment::isArchMIPS64(Arch arch)staticnoexcept

Tests whether the given architecture is MIPS64_LE or MIPS64_BE.

bool Environment::isFamilyX86(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is X86 or X64.

bool Environment::isFamilyARM(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is ARM, THUMB, or AArch64.

bool Environment::isFamilyAArch32(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is AArch32 (ARM or THUMB).

bool Environment::isFamilyAArch64(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is AArch64.

bool Environment::isFamilyMIPS(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is MISP or MIPS64.

bool Environment::isFamilyRISCV(Arch arch)staticnoexcept[2/2]

Tests whether the given architecture family is RISC-V (both 32-bit and 64-bit).

uint32_t Environment::registerSizeFromArch(Arch arch)staticnoexcept

Returns a native general purpose register size from the given architecture.

Member Data Documentation

Arch Environment::_arch

Architecture.

SubArch Environment::_subArch

Sub-architecture type.

Vendor Environment::_vendor

Vendor type.

Platform Environment::_platform

Platform.

PlatformABI Environment::_platformABI

Platform ABI.

ObjectFormat Environment::_objectFormat

Object format.

uint8_t Environment::_reserved[2]

Reserved for future use, must be zero.