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>
impl<'ctx, 'str> BodyView<'ctx, 'str>
pub fn new( body: &'ctx FunctionBody<'str>, shared: &'ctx Shared<'str>, interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>, ) -> Self
pub fn function_id(self) -> FunctionId
Trait Implementations§
impl<'ctx, 'str> Copy for BodyView<'ctx, 'str>
Source§impl<'ctx, 'str: 'ctx> QCodeView<'ctx, 'str> for BodyView<'ctx, 'str>
impl<'ctx, 'str: 'ctx> QCodeView<'ctx, 'str> for BodyView<'ctx, 'str>
fn interface(self, id: FunctionId) -> &'ctx FunctionInterface<'str>
fn function(self, id: FunctionId) -> &'ctx FunctionBody<'str>
Source§fn owner(self) -> Option<FunctionId>
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).fn instruction(self, id: InstructionId) -> &'ctx Instruction<'str>
fn contains_instruction(self, id: InstructionId) -> bool
fn block(self, id: BlockId) -> &'ctx BasicBlock<'str>
fn contains_block(self, id: BlockId) -> bool
fn block_param(self, id: BlockParamId) -> &'ctx BlockParam<'str>
fn contains_block_param(self, id: BlockParamId) -> bool
fn edge(self, function: FunctionId, id: EdgeId) -> &'ctx EdgeData
fn temp_space(self, id: TempSpaceId) -> &'ctx TempSpace
fn contains_temp_space(self, id: TempSpaceId) -> bool
fn temp(self, id: TempId) -> &'ctx Temp<'str>
fn contains_temp(self, id: TempId) -> bool
fn type_of(self, id: ValueId) -> TypeId
fn stored_type_of(self, id: ValueId) -> Option<TypeId>
fn block_ref(self, id: BlockId) -> BlockRef<'str, 'ctx, Self>where
Self: Sized,
fn insn_ref(self, id: InstructionId) -> InstructionRef<'str, 'ctx, Self>where
Self: Sized,
fn param_ref(self, id: BlockParamId) -> BlockParamRef<'str, 'ctx, Self>where
Self: Sized,
fn function_ref(self, id: FunctionId) -> FunctionRef<'str, 'ctx, Self>where
Self: Sized,
fn temp_space_ref(self, id: TempSpaceId) -> TempSpaceRef<'str, 'ctx, Self>where
Self: Sized,
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> 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