pub struct LiftToSpvPtrs<'a> {
cx: Rc<Context>,
wk: &'static WellKnown,
layout_cache: LayoutCache<'a>,
cached_u32_type: Cell<Option<Type>>,
}
Expand description
Context for lifting QPtr
s to SPIR-V OpTypePointer
s.
See also passes::qptr::lift_to_spv_ptrs
(which drives this).
Fields§
§cx: Rc<Context>
§wk: &'static WellKnown
§layout_cache: LayoutCache<'a>
§cached_u32_type: Cell<Option<Type>>
Implementations§
source§impl<'a> LiftToSpvPtrs<'a>
impl<'a> LiftToSpvPtrs<'a>
pub fn new(cx: Rc<Context>, layout_config: &'a LayoutConfig) -> Self
pub fn lift_global_var(&self, global_var_decl: &mut GlobalVarDecl)
pub fn lift_all_funcs( &self, module: &mut Module, funcs: impl IntoIterator<Item = Func>, )
fn find_qptr_usage_attr(&self, attrs: AttrSet) -> Result<&QPtrUsage, LiftError>
fn strip_qptr_usage_attr(&self, attrs: AttrSet) -> AttrSet
fn spv_ptr_type_and_addr_space_for_global_var( &self, global_var_decl: &GlobalVarDecl, ) -> Result<(Type, AddrSpace), LiftError>
sourcefn as_spv_ptr_type(&self, ty: Type) -> Option<(AddrSpace, Type)>
fn as_spv_ptr_type(&self, ty: Type) -> Option<(AddrSpace, Type)>
Returns Some
iff ty
is a SPIR-V OpTypePointer
.
fn spv_ptr_type(&self, addr_space: AddrSpace, pointee_type: Type) -> Type
fn pointee_type_for_usage(&self, usage: &QPtrUsage) -> Result<Type, LiftError>
fn pointee_type_for_mem_usage( &self, usage: &QPtrMemUsage, ) -> Result<Type, LiftError>
fn spv_op_type_array( &self, element_type: Type, fixed_len: Option<u32>, stride: Option<NonZeroU32>, ) -> Result<Type, LiftError>
fn spv_op_type_struct( &self, field_offsets_and_types: impl IntoIterator<Item = Result<(u32, Type), LiftError>>, extra_attrs: impl IntoIterator<Item = Attr>, ) -> Result<Type, LiftError>
fn const_u32(&self, x: u32) -> Const
Auto Trait Implementations§
impl<'a> !Freeze for LiftToSpvPtrs<'a>
impl<'a> !RefUnwindSafe for LiftToSpvPtrs<'a>
impl<'a> !Send for LiftToSpvPtrs<'a>
impl<'a> !Sync for LiftToSpvPtrs<'a>
impl<'a> Unpin for LiftToSpvPtrs<'a>
impl<'a> !UnwindSafe for LiftToSpvPtrs<'a>
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> 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>
Converts
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>
Converts
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 more