pub struct DataLayout {
pub little_endian: bool,
pub pointer_bits: u32,
pub pointer_align: u32,
pub i64_align: u32,
pub f80_align: Option<u32>,
pub stack_align: u32,
}Expand description
The layout facts a printed module carries so it can be compiled without the command line that produced it.
A subset of the string LLVM writes, in the same syntax, because that syntax is what tools around the ecosystem already read. It says what the module was built assuming, and the verifier is what checks it against the target actually being compiled for: a module built for a 64-bit pointer cannot be finished for a 32-bit one, and finding that out here is better than finding it out as wrong output.
Fields§
§little_endian: boolWhether the low byte of a scalar is stored first.
pointer_bits: u32The width of a pointer in bits.
pointer_align: u32The alignment of a pointer in bits.
i64_align: u32The alignment of a 64-bit integer in bits, which is the one integer alignment that varies across the targets anybody still builds for.
f80_align: Option<u32>The alignment of the x87 eighty bit format in bits, and None on a target that does
not have it.
stack_align: u32The alignment the stack is kept at in bits, which is 128 on every target here.
Implementations§
Source§impl DataLayout
impl DataLayout
Sourcepub fn for_target(target: &TargetInfo) -> Self
pub fn for_target(target: &TargetInfo) -> Self
The layout of that target.
Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
The layout back from the string Display wrote, or None if the
string is not one.
The fields may come in any order, because a string written by hand will not have them
in ours. A string this crate printed round-trips byte for byte, which is what
spec/03-architecture.md asks of the textual form.
Trait Implementations§
Source§impl Clone for DataLayout
impl Clone for DataLayout
Source§fn clone(&self) -> DataLayout
fn clone(&self) -> DataLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more