pub struct LowerFromSpvPtrs<'a> {
    cx: Rc<Context>,
    wk: &'static WellKnown,
    layout_cache: LayoutCache<'a>,
    cached_qptr_type: Cell<Option<Type>>,
}
Expand description

Context for lowering SPIR-V OpTypePointers to QPtrs.

See also passes::qptr::lower_from_spv_ptrs (which drives this).

Fields§

§cx: Rc<Context>§wk: &'static WellKnown§layout_cache: LayoutCache<'a>§cached_qptr_type: Cell<Option<Type>>

Implementations§

source§

impl<'a> LowerFromSpvPtrs<'a>

source

pub fn new(cx: Rc<Context>, layout_config: &'a LayoutConfig) -> Self

source

pub fn lower_global_var(&self, global_var_decl: &mut GlobalVarDecl)

source

pub fn lower_func(&self, func_decl: &mut FuncDecl)

source

fn as_spv_ptr_type(&self, ty: Type) -> Option<(AddrSpace, Type)>

Returns Some iff ty is a SPIR-V OpTypePointer.

source

fn const_as_u32(&self, ct: Const) -> Option<u32>

source

fn qptr_type(&self) -> Type

Get the (likely cached) QPtr type.

source

fn layout_of(&self, ty: Type) -> Result<TypeLayout, LowerError>

Attempt to compute a TypeLayout for a given (SPIR-V) Type.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LowerFromSpvPtrs<'a>

§

impl<'a> !Send for LowerFromSpvPtrs<'a>

§

impl<'a> !Sync for LowerFromSpvPtrs<'a>

§

impl<'a> Unpin for LowerFromSpvPtrs<'a>

§

impl<'a> !UnwindSafe for LowerFromSpvPtrs<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.