Skip to main content

BodyView

Struct BodyView 

Source
pub struct BodyView<'ctx, 'str> { /* private fields */ }
Expand description

Single-body immutable provider used by function passes.

Implementations§

Source§

impl<'ctx, 'str> BodyView<'ctx, 'str>

Source

pub fn new( body: &'ctx FunctionBody<'str>, shared: &'ctx Shared<'str>, interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>, ) -> Self

Source

pub fn function_id(self) -> FunctionId

Trait Implementations§

Source§

impl<'ctx, 'str> Clone for BodyView<'ctx, 'str>

Source§

fn clone(&self) -> BodyView<'ctx, 'str>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'ctx, 'str> Copy for BodyView<'ctx, 'str>

Source§

impl<'ctx, 'str: 'ctx> QCodeView<'ctx, 'str> for BodyView<'ctx, 'str>

Source§

fn shared(self) -> &'ctx Shared<'str>

Source§

fn interface(self, id: FunctionId) -> &'ctx FunctionInterface<'str>

Source§

fn function(self, id: FunctionId) -> &'ctx FunctionBody<'str>

Source§

fn owner(self) -> Option<FunctionId>

The single function this view is scoped to, if any. A whole-module view returns None (it may read every function); a function-pass BodyView returns its owner, so callers can avoid a cross-function read that the locality guard would panic on (e.g. rendering a foreign SymbolicRef::Block falls back to the numeric form instead of resolving its name).
Source§

fn instruction(self, id: InstructionId) -> &'ctx Instruction<'str>

Source§

fn contains_instruction(self, id: InstructionId) -> bool

Source§

fn block(self, id: BlockId) -> &'ctx BasicBlock<'str>

Source§

fn contains_block(self, id: BlockId) -> bool

Source§

fn block_param(self, id: BlockParamId) -> &'ctx BlockParam<'str>

Source§

fn contains_block_param(self, id: BlockParamId) -> bool

Source§

fn edge(self, function: FunctionId, id: EdgeId) -> &'ctx EdgeData

Source§

fn temp_space(self, id: TempSpaceId) -> &'ctx TempSpace

Source§

fn contains_temp_space(self, id: TempSpaceId) -> bool

Source§

fn temp(self, id: TempId) -> &'ctx Temp<'str>

Source§

fn contains_temp(self, id: TempId) -> bool

Source§

fn type_of(self, id: ValueId) -> TypeId

Source§

fn stored_type_of(self, id: ValueId) -> Option<TypeId>

Source§

fn block_ref(self, id: BlockId) -> BlockRef<'str, 'ctx, Self>
where Self: Sized,

Source§

fn insn_ref(self, id: InstructionId) -> InstructionRef<'str, 'ctx, Self>
where Self: Sized,

Source§

fn param_ref(self, id: BlockParamId) -> BlockParamRef<'str, 'ctx, Self>
where Self: Sized,

Source§

fn function_ref(self, id: FunctionId) -> FunctionRef<'str, 'ctx, Self>
where Self: Sized,

Source§

fn temp_space_ref(self, id: TempSpaceId) -> TempSpaceRef<'str, 'ctx, Self>
where Self: Sized,

Source§

fn temp_ref(self, id: TempId) -> TempRef<'str, 'ctx, Self>
where Self: Sized,

Auto Trait Implementations§

§

impl<'ctx, 'str> Freeze for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> RefUnwindSafe for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> Send for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> Sync for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> Unpin for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> UnsafeUnpin for BodyView<'ctx, 'str>

§

impl<'ctx, 'str> UnwindSafe for BodyView<'ctx, 'str>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.