Struct rustc_codegen_ssa::mir::operand::OperandRef [−][src]
pub struct OperandRef<'tcx, V> {
pub val: OperandValue<V>,
pub layout: TyAndLayout<'tcx>,
}
Expand description
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
pub fn new_zst<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx,
layout: TyAndLayout<'tcx>
) -> OperandRef<'tcx, V>
pub fn from_const<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx,
val: ConstValue<'tcx>,
ty: Ty<'tcx>
) -> Self
Asserts that this operand refers to a scalar and returns a reference to its value.
pub fn immediate_or_packed_pair<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
self,
bx: &mut Bx
) -> V
pub fn immediate_or_packed_pair<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
self,
bx: &mut Bx
) -> V
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
pub fn from_immediate_or_packed_pair<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx,
llval: V,
layout: TyAndLayout<'tcx>
) -> Self
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
Trait Implementations
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
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.