Struct regalloc::Writable [−][src]
A “writable register”. This is a zero-cost wrapper that can be used to create a distinction, at the Rust type level, between a plain “register” and a “writable register”.
Only structs that implement the WritableBase
trait can be wrapped with
Writable
. These are the Reg, RealReg and VirtualReg data structures only,
since WritableBase
is not exposed to end users.
Writable<..> can be used by the client to ensure that, internally, it only
generates instructions that write to registers that should be written. The
InstRegUses
below, which must be implemented for every instruction,
requires a Writable<Reg>
(not just Reg
) in its defined
and
modified
sets. While we cannot hide the constructor for Writable<..>
from certain parts of the client while exposing it to others, the client
can adopt conventions to e.g. only ever call the Writable<..>
constructor from its central vreg-management logic, and decide that any
invocation of this constructor in a machine backend (for example) is an
error.
Implementations
impl<R: WritableBase> Writable<R>
[src]
pub fn from_reg(reg: R) -> Writable<R>
[src]
Create a WritableWritable<..>
struct documentation).
pub fn to_reg(&self) -> R
[src]
Get the inner Reg.
pub fn map<F, U>(&self, f: F) -> Writable<U> where
F: Fn(R) -> U,
U: WritableBase,
[src]
F: Fn(R) -> U,
U: WritableBase,
Trait Implementations
impl<R: Clone + WritableBase> Clone for Writable<R>
[src]
impl<R: Copy + WritableBase> Copy for Writable<R>
[src]
impl<R: Debug + WritableBase> Debug for Writable<R>
[src]
impl<R: Eq + WritableBase> Eq for Writable<R>
[src]
impl<R: Hash + WritableBase> Hash for Writable<R>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<R: Ord + WritableBase> Ord for Writable<R>
[src]
fn cmp(&self, other: &Writable<R>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<R: PartialEq + WritableBase> PartialEq<Writable<R>> for Writable<R>
[src]
impl<R: PartialOrd + WritableBase> PartialOrd<Writable<R>> for Writable<R>
[src]
fn partial_cmp(&self, other: &Writable<R>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<R: PrettyPrint + WritableBase> PrettyPrint for Writable<R>
[src]
fn show_rru(&self, maybe_reg_universe: Option<&RealRegUniverse>) -> String
[src]
impl<R: PrettyPrintSized + WritableBase> PrettyPrintSized for Writable<R>
[src]
fn show_rru_sized(
&self,
maybe_reg_universe: Option<&RealRegUniverse>,
size: u8
) -> String
[src]
&self,
maybe_reg_universe: Option<&RealRegUniverse>,
size: u8
) -> String
impl<R: WritableBase> StructuralEq for Writable<R>
[src]
impl<R: WritableBase> StructuralPartialEq for Writable<R>
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for Writable<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Writable<R> where
R: Send,
R: Send,
impl<R> Sync for Writable<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Writable<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Writable<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,