silk/target
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.
Typed compile-time facts for the selected compilation profile.
When to use
Use arch and operatingSystem to select source behavior for a machine. Use pointerBits
for pointer-sized arithmetic. Read logical artifact and runtime requests through silk.compilation.
Details
These facts are fixed before static evaluation. They have no runtime storage.
Import as Target with import silk.target { Target }.
Public declarations: 11.
Arch
pub enum ArchThe instruction-set architectures supported by the compiler.
Aarch64
Aarch64 = 0The Aarch64 choice.
Wasm32
Wasm32 = 1The Wasm32 choice.
X86_64
X86_64 = 2The X86_64 choice.
OperatingSystem
pub enum OperatingSystemThe operating systems supported by the compiler.
Darwin
Darwin = 0The Darwin choice.
Linux
Linux = 1The Linux choice.
Freestanding
Freestanding = 2The Freestanding choice.
Abi
pub enum AbiThe platform calling conventions supported by the compiler.
Apple
Apple = 0The Apple choice.
Gnu
Gnu = 1The Gnu choice.
Wasm
Wasm = 2The Wasm choice.
ObjectFormat
pub enum ObjectFormatThe object-file formats supported by the compiler.
MachO
MachO = 0The MachO choice.
Elf
Elf = 1The Elf choice.
Wasm
Wasm = 2The Wasm choice.
Endianness
pub enum EndiannessThe byte orders supported by the compiler.
Little
Little = 0The Little choice.
pointerBits
pub const pointerBits: u32The pointer width of the selected compilation target, in bits.
usizeMax
pub const usizeMax: usizeThe greatest usize value supported by the selected compilation target.
isizeMax
pub const isizeMax: isizeThe greatest isize value supported by the selected compilation target.
isizeMin
pub const isizeMin: isizeThe least isize value supported by the selected compilation target.
pointerAlignment
pub const pointerAlignment: u32The alignment of a data pointer, in bytes.
Target
pub struct TargetThe scope for Target operations.
Details
This owner carries no data. Select it with import silk.target { Target }
to access its inherent operations.
Associated function Target.arch
pub static fn arch() -> ArchReturns the selected Arch during static evaluation.
Associated function Target.operatingSystem
pub static fn operatingSystem() -> OperatingSystemReturns the selected OperatingSystem during static evaluation.
Associated function Target.abi
pub static fn abi() -> AbiReturns the selected Abi during static evaluation.
Associated function Target.objectFormat
pub static fn objectFormat() -> ObjectFormatReturns the selected ObjectFormat during static evaluation.
Associated function Target.endianness
pub static fn endianness() -> EndiannessReturns the selected Endianness during static evaluation.
Associated function Target.cpu
pub static fn cpu() -> string<'static>Returns the logical cpu selection.
Associated function Target.deployment
pub static fn deployment() -> string<'static>Returns the logical deployment selection.
Associated function Target.hasCpuFeature
pub static fn hasCpuFeature(static value: string<'static>) -> boolWhether a canonical CPU feature is enabled.