pub struct Context<'eng> {
pub source_engine: &'eng SourceEngine,
pub program_kind: Kind,
/* private fields */
}
Expand description
The main IR context handle.
Every module, function, block and value is stored here. Some aggregate metadata is also managed by the context.
Fields§
§source_engine: &'eng SourceEngine
§program_kind: Kind
Implementations§
source§impl<'eng> Context<'eng>
impl<'eng> Context<'eng>
pub fn new(source_engine: &'eng SourceEngine) -> Self
pub fn source_engine(&self) -> &'eng SourceEngine
sourcepub fn module_iter(&self) -> ModuleIterator ⓘ
pub fn module_iter(&self) -> ModuleIterator ⓘ
Return an interator for every module in this context.
sourcepub fn get_unique_name(&mut self) -> String
pub fn get_unique_name(&mut self) -> String
Get a globally unique symbol.
The name will be in the form "anon_N"
, where N
is an incrementing decimal.
sourcepub fn get_unique_id(&mut self) -> u64
pub fn get_unique_id(&mut self) -> u64
Get a globally unique symbol id.
Trait Implementations§
Auto Trait Implementations§
impl<'eng> RefUnwindSafe for Context<'eng>
impl<'eng> Send for Context<'eng>
impl<'eng> Sync for Context<'eng>
impl<'eng> Unpin for Context<'eng>
impl<'eng> UnwindSafe for Context<'eng>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.