[−][src]Struct rustc_codegen_ssa::mir::operand::OperandRef

pub struct OperandRef<'tcx, V> {
    pub val: OperandValue<V>,
    pub layout: TyAndLayout<'tcx>,
}

An OperandRef is an "SSA" reference to a Rust value, along with its type.

NOTE: unless you know a value's type exactly, you should not generate LLVM opcodes acting on it and instead act via methods, to avoid nasty edge cases. In particular, using Builder::store directly is sure to cause problems -- use OperandRef::store instead.

Fields

val: OperandValue<V>layout: TyAndLayout<'tcx>

Implementations

impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V>[src]

pub fn new_zst<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
    bx: &mut Bx,
    layout: TyAndLayout<'tcx>
) -> OperandRef<'tcx, V>
[src]

pub fn from_const<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
    bx: &mut Bx,
    val: ConstValue<'tcx>,
    ty: Ty<'tcx>
) -> Self
[src]

pub fn immediate(self) -> V[src]

Asserts that this operand refers to a scalar and returns a reference to its value.

pub fn deref<Cx: LayoutTypeMethods<'tcx>>(self, cx: &Cx) -> PlaceRef<'tcx, V>[src]

pub fn immediate_or_packed_pair<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
    self,
    bx: &mut Bx
) -> V
[src]

If this operand is a Pair, we return an aggregate with the two values. For other cases, see immediate.

pub fn from_immediate_or_packed_pair<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
    bx: &mut Bx,
    llval: V,
    layout: TyAndLayout<'tcx>
) -> Self
[src]

If the type is a pair, we return a Pair, otherwise, an Immediate.

pub fn extract_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
    &self,
    bx: &mut Bx,
    i: usize
) -> Self
[src]

Trait Implementations

impl<'tcx, V: Clone> Clone for OperandRef<'tcx, V>[src]

impl<'tcx, V: Copy> Copy for OperandRef<'tcx, V>[src]

impl<V: CodegenObject, 'tcx> Debug for OperandRef<'tcx, V>[src]

Auto Trait Implementations

impl<'tcx, V> !RefUnwindSafe for OperandRef<'tcx, V>

impl<'tcx, V> !Send for OperandRef<'tcx, V>

impl<'tcx, V> !Sync for OperandRef<'tcx, V>

impl<'tcx, V> Unpin for OperandRef<'tcx, V> where
    V: Unpin, 

impl<'tcx, V> !UnwindSafe for OperandRef<'tcx, V>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.