pub struct Pointer<B: Builder> {
pub ty: B::Type,
pub base: PointerBase<B>,
}
Expand description
A pointer to a value.
Fields§
§ty: B::Type
The type of the pointee.
base: PointerBase<B>
The base of the pointer. Either an address or a stack slot.
Implementations§
Source§impl<B: Builder> Pointer<B>
impl<B: Builder> Pointer<B>
Sourcepub fn new_stack_slot(bcx: &mut B, ty: B::Type, name: &str) -> Self
pub fn new_stack_slot(bcx: &mut B, ty: B::Type, name: &str) -> Self
Creates a new stack-allocated pointer.
Sourcepub fn new_address(ty: B::Type, value: B::Value) -> Self
pub fn new_address(ty: B::Type, value: B::Value) -> Self
Creates a new address pointer.
Sourcepub fn is_address(&self) -> bool
pub fn is_address(&self) -> bool
Returns true
if the pointer is an address.
Sourcepub fn is_stack_slot(&self) -> bool
pub fn is_stack_slot(&self) -> bool
Returns true
if the pointer is a stack slot.
Sourcepub fn into_address(self) -> Option<B::Value>
pub fn into_address(self) -> Option<B::Value>
Converts the pointer to an address.
Sourcepub fn into_stack_slot(self) -> Option<B::StackSlot>
pub fn into_stack_slot(self) -> Option<B::StackSlot>
Converts the pointer to a stack slot.
Trait Implementations§
impl<B: Copy + Builder> Copy for Pointer<B>
Auto Trait Implementations§
impl<B> Freeze for Pointer<B>where
<B as BackendTypes>::Type: Freeze,
<B as BackendTypes>::Value: Freeze,
<B as BackendTypes>::StackSlot: Freeze,
impl<B> RefUnwindSafe for Pointer<B>where
<B as BackendTypes>::Type: RefUnwindSafe,
<B as BackendTypes>::Value: RefUnwindSafe,
<B as BackendTypes>::StackSlot: RefUnwindSafe,
impl<B> Send for Pointer<B>where
<B as BackendTypes>::Type: Send,
<B as BackendTypes>::Value: Send,
<B as BackendTypes>::StackSlot: Send,
impl<B> Sync for Pointer<B>where
<B as BackendTypes>::Type: Sync,
<B as BackendTypes>::Value: Sync,
<B as BackendTypes>::StackSlot: Sync,
impl<B> Unpin for Pointer<B>where
<B as BackendTypes>::Type: Unpin,
<B as BackendTypes>::Value: Unpin,
<B as BackendTypes>::StackSlot: Unpin,
impl<B> UnwindSafe for Pointer<B>where
<B as BackendTypes>::Type: UnwindSafe,
<B as BackendTypes>::Value: UnwindSafe,
<B as BackendTypes>::StackSlot: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.