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 MemFlags
pub fn new() -> Self
[src]
pub fn new() -> Self
Create 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) -> bool
Set 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) -> bool
Test 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) -> bool
Test 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 MemFlags
fn clone(&self) -> MemFlags
[src]
fn clone(&self) -> MemFlags
Returns 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 MemFlags
impl Debug for MemFlags
[src]
impl Debug for MemFlags
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for MemFlags
[src]
impl Hash for MemFlags
fn 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 MemFlags
fn eq(&self, other: &MemFlags) -> bool
[src]
fn eq(&self, other: &MemFlags) -> bool
This 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) -> bool
This method tests for !=
.
impl Eq for MemFlags
[src]
impl Eq for MemFlags
impl Display for MemFlags
[src]
impl Display for MemFlags