pub struct Context {
pub aux_data: SlotMap<AuxDataIndex, Box<dyn Any + Send>>,
pub aux_data_map: HMap<Identifier, AuxDataIndex>,
/* private fields */
}Expand description
A context stores all IR data of this compilation session.
Fields§
§aux_data: SlotMap<AuxDataIndex, Box<dyn Any + Send>>Arbitrary data storage. Use Self::aux_data_map for dictionary access.
aux_data_map: HMap<Identifier, AuxDataIndex>A dictionary with keys mapping to an index in Self::aux_data.
Implementations§
Trait Implementations§
Source§impl ContextExt for Context
impl ContextExt for Context
fn aux_ty<T: Send + 'static>(&self) -> &T
fn aux_ty_mut<T: Send + 'static>(&mut self) -> &mut T
fn set_aux_ty<T: Send + 'static>(&mut self, value: T)
fn set_address_type(&mut self, addr: AddressType)
fn address_type(&self) -> AddressType
Source§impl ControlFlowGraph<Context> for Ptr<Region>
impl ControlFlowGraph<Context> for Ptr<Region>
type Node = Ptr<BasicBlock>
Source§fn num_successors(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
) -> usize
fn num_successors( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, ) -> usize
Number of successors of
node.Source§fn get_successor(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
i: usize,
) -> <Ptr<Region> as ControlFlowGraph<Context>>::Node
fn get_successor( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, i: usize, ) -> <Ptr<Region> as ControlFlowGraph<Context>>::Node
Get the
i-th successor of node. Panics if i is out of bounds.Source§fn successors(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
) -> Vec<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
fn successors( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, ) -> Vec<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
Get all successors of
node.
The default implementation provided may be overridden for better performance.Source§fn num_predecessors(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
) -> usize
fn num_predecessors( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, ) -> usize
Number of predecessors of
node.Source§fn get_predecessor(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
i: usize,
) -> <Ptr<Region> as ControlFlowGraph<Context>>::Node
fn get_predecessor( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, i: usize, ) -> <Ptr<Region> as ControlFlowGraph<Context>>::Node
Get the
i-th predecessor of node. Panics if i is out of bounds.Source§fn predecessors(
&self,
ctx: &Context,
node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node,
) -> Vec<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
fn predecessors( &self, ctx: &Context, node: &<Ptr<Region> as ControlFlowGraph<Context>>::Node, ) -> Vec<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
Get all predecessors of
node.
The default implementation provided may be overridden for better performance.Source§fn entry_node(
&self,
ctx: &Context,
) -> Option<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
fn entry_node( &self, ctx: &Context, ) -> Option<<Ptr<Region> as ControlFlowGraph<Context>>::Node>
Returns the entry node of the graph.
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !Sync for Context
impl !UnwindSafe for Context
impl Send for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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