Struct rustc_codegen_ssa::mir::operand::OperandRef
source · 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>
The value.
layout: TyAndLayout<'tcx>
The layout of value, based on its Rust type.
Implementations§
source§impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V>
impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V>
pub fn zero_sized(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
fn from_const_alloc<Bx: BuilderMethods<'a, 'tcx, Value = V>>( bx: &mut Bx, layout: TyAndLayout<'tcx>, alloc: ConstAllocation<'tcx>, offset: Size ) -> Self
sourcepub fn immediate(self) -> V
pub fn immediate(self) -> V
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>
sourcepub 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
.
sourcepub 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§
source§impl<'tcx, V: Clone> Clone for OperandRef<'tcx, V>
impl<'tcx, V: Clone> Clone for OperandRef<'tcx, V>
source§fn clone(&self) -> OperandRef<'tcx, V>
fn clone(&self) -> OperandRef<'tcx, V>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<V: CodegenObject> Debug for OperandRef<'_, V>
impl<V: CodegenObject> Debug for OperandRef<'_, V>
impl<'tcx, V: Copy> Copy for OperandRef<'tcx, V>
Auto Trait Implementations§
impl<'tcx, V> DynSend for OperandRef<'tcx, V>where
V: DynSend,
impl<'tcx, V> DynSync for OperandRef<'tcx, V>where
V: DynSync,
impl<'tcx, V> Freeze for OperandRef<'tcx, V>where
V: Freeze,
impl<'tcx, V> !RefUnwindSafe for OperandRef<'tcx, V>
impl<'tcx, V> Send for OperandRef<'tcx, V>where
V: Send,
impl<'tcx, V> Sync for OperandRef<'tcx, V>where
V: Sync,
impl<'tcx, V> Unpin for OperandRef<'tcx, V>where
V: Unpin,
impl<'tcx, V> !UnwindSafe for OperandRef<'tcx, V>
Blanket Implementations§
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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.