Struct cranelift_codegen::ir::MemFlags [−][src]
pub struct MemFlags { /* fields omitted */ }Flags for memory operations like load/store.
Each of these flags introduce a limited form of undefined behavior. The flags each enable certain optimizations that need to make additional assumptions. Generally, the semantics of a program does not change when a flag is removed, but adding a flag will.
Methods
impl MemFlags[src]
impl MemFlagspub fn new() -> Self[src]
pub fn new() -> SelfCreate a new empty set of flags.
pub fn set_by_name(&mut self, name: &str) -> bool[src]
pub fn set_by_name(&mut self, name: &str) -> boolSet a flag bit by name.
Returns true if the flag was found and set, false for an unknown flag name.
pub fn notrap(self) -> bool[src]
pub fn notrap(self) -> boolTest if the notrap flag is set.
Normally, trapping is part of the semantics of a load/store operation. If the platform would cause a trap when accessing the effective address, the Cranelift memory operation is also required to trap.
The notrap flag tells Cranelift that the memory is accessible, which means that
accesses will not trap. This makes it possible to delete an unused load or a dead store
instruction.
pub fn set_notrap(&mut self)[src]
pub fn set_notrap(&mut self)Set the notrap flag.
pub fn aligned(self) -> bool[src]
pub fn aligned(self) -> boolTest if the aligned flag is set.
By default, Cranelift memory instructions work with any unaligned effective address. If the
aligned flag is set, the instruction is permitted to trap or return a wrong result if the
effective address is misaligned.
pub fn set_aligned(&mut self)[src]
pub fn set_aligned(&mut self)Set the aligned flag.
Trait Implementations
impl Clone for MemFlags[src]
impl Clone for MemFlagsfn clone(&self) -> MemFlags[src]
fn clone(&self) -> MemFlagsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for MemFlags[src]
impl Copy for MemFlagsimpl Debug for MemFlags[src]
impl Debug for MemFlagsfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for MemFlags[src]
impl Hash for MemFlagsfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl PartialEq for MemFlags[src]
impl PartialEq for MemFlagsfn eq(&self, other: &MemFlags) -> bool[src]
fn eq(&self, other: &MemFlags) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &MemFlags) -> bool[src]
fn ne(&self, other: &MemFlags) -> boolThis method tests for !=.
impl Eq for MemFlags[src]
impl Eq for MemFlagsimpl Display for MemFlags[src]
impl Display for MemFlags