pub(super) struct OperandRefBuilder<'tcx, V> {
val: OperandValueBuilder<V>,
layout: TyAndLayout<'tcx>,
}
Expand description
Allows building up an OperandRef
by setting fields one at a time.
Fields§
§val: OperandValueBuilder<V>
§layout: TyAndLayout<'tcx>
Implementations§
Source§impl<'a, 'tcx, V: CodegenObject> OperandRefBuilder<'tcx, V>
impl<'a, 'tcx, V: CodegenObject> OperandRefBuilder<'tcx, V>
Sourcepub(super) fn new(layout: TyAndLayout<'tcx>) -> Self
pub(super) fn new(layout: TyAndLayout<'tcx>) -> Self
Creates an uninitialized builder for an instance of the layout
.
ICEs for BackendRepr::Memory
types (other than ZSTs), which should
be built up inside a PlaceRef
instead as they need an allocated place
into which to write the values of the fields.
pub(super) fn insert_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>( &mut self, bx: &mut Bx, variant: VariantIdx, field: FieldIdx, field_operand: OperandRef<'tcx, V>, )
Sourcepub(super) fn insert_imm(&mut self, f: FieldIdx, imm: V)
pub(super) fn insert_imm(&mut self, f: FieldIdx, imm: V)
Insert the immediate value imm
for field f
in the type itself,
rather than into one of the variants.
Most things want Self::insert_field
instead, but this one is
necessary for writing things like enum tags that aren’t in any variant.
Sourcepub(super) fn build(
&self,
cx: &impl CodegenMethods<'tcx, Value = V>,
) -> OperandRef<'tcx, V>
pub(super) fn build( &self, cx: &impl CodegenMethods<'tcx, Value = V>, ) -> OperandRef<'tcx, V>
After having set all necessary fields, this converts the builder back
to the normal OperandRef
.
ICEs if any required fields were not set.
Trait Implementations§
Source§impl<'tcx, V: Clone> Clone for OperandRefBuilder<'tcx, V>
impl<'tcx, V: Clone> Clone for OperandRefBuilder<'tcx, V>
Source§fn clone(&self) -> OperandRefBuilder<'tcx, V>
fn clone(&self) -> OperandRefBuilder<'tcx, V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'tcx, V: Debug> Debug for OperandRefBuilder<'tcx, V>
impl<'tcx, V: Debug> Debug for OperandRefBuilder<'tcx, V>
impl<'tcx, V: Copy> Copy for OperandRefBuilder<'tcx, V>
Auto Trait Implementations§
impl<'tcx, V> DynSend for OperandRefBuilder<'tcx, V>where
V: DynSend,
impl<'tcx, V> DynSync for OperandRefBuilder<'tcx, V>where
V: DynSync,
impl<'tcx, V> Freeze for OperandRefBuilder<'tcx, V>where
V: Freeze,
impl<'tcx, V> !RefUnwindSafe for OperandRefBuilder<'tcx, V>
impl<'tcx, V> Send for OperandRefBuilder<'tcx, V>where
V: Send,
impl<'tcx, V> Sync for OperandRefBuilder<'tcx, V>where
V: Sync,
impl<'tcx, V> Unpin for OperandRefBuilder<'tcx, V>where
V: Unpin,
impl<'tcx, V> !UnwindSafe for OperandRefBuilder<'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(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx 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(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> 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<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.