Struct cranelift_reader::SourceMap
source · [−]pub struct SourceMap { /* private fields */ }
Expand description
Mapping from entity names to source locations.
Implementations
sourceimpl SourceMap
impl SourceMap
Read-only interface which is exposed outside the parser crate.
sourcepub fn contains_value(&self, v: Value) -> bool
pub fn contains_value(&self, v: Value) -> bool
Look up a value entity.
sourcepub fn contains_block(&self, block: Block) -> bool
pub fn contains_block(&self, block: Block) -> bool
Look up a block entity.
sourcepub fn contains_ss(&self, ss: StackSlot) -> bool
pub fn contains_ss(&self, ss: StackSlot) -> bool
Look up a stack slot entity.
sourcepub fn contains_gv(&self, gv: GlobalValue) -> bool
pub fn contains_gv(&self, gv: GlobalValue) -> bool
Look up a global value entity.
sourcepub fn contains_heap(&self, heap: Heap) -> bool
pub fn contains_heap(&self, heap: Heap) -> bool
Look up a heap entity.
sourcepub fn contains_table(&self, table: Table) -> bool
pub fn contains_table(&self, table: Table) -> bool
Look up a table entity.
sourcepub fn contains_sig(&self, sig: SigRef) -> bool
pub fn contains_sig(&self, sig: SigRef) -> bool
Look up a signature entity.
sourcepub fn contains_fn(&self, fn_: FuncRef) -> bool
pub fn contains_fn(&self, fn_: FuncRef) -> bool
Look up a function entity.
sourcepub fn contains_jt(&self, jt: JumpTable) -> bool
pub fn contains_jt(&self, jt: JumpTable) -> bool
Look up a jump table entity.
sourcepub fn contains_constant(&self, c: Constant) -> bool
pub fn contains_constant(&self, c: Constant) -> bool
Look up a constant entity.
sourcepub fn lookup_str(&self, name: &str) -> Option<AnyEntity>
pub fn lookup_str(&self, name: &str) -> Option<AnyEntity>
Look up an entity by source name.
Returns the entity reference corresponding to name
, if it exists.
sourceimpl SourceMap
impl SourceMap
sourcepub fn def_value(&mut self, entity: Value, loc: Location) -> ParseResult<()>
pub fn def_value(&mut self, entity: Value, loc: Location) -> ParseResult<()>
Define the value entity
.
sourcepub fn def_block(&mut self, entity: Block, loc: Location) -> ParseResult<()>
pub fn def_block(&mut self, entity: Block, loc: Location) -> ParseResult<()>
Define the block entity
.
sourcepub fn def_ss(&mut self, entity: StackSlot, loc: Location) -> ParseResult<()>
pub fn def_ss(&mut self, entity: StackSlot, loc: Location) -> ParseResult<()>
Define the stack slot entity
.
sourcepub fn def_gv(&mut self, entity: GlobalValue, loc: Location) -> ParseResult<()>
pub fn def_gv(&mut self, entity: GlobalValue, loc: Location) -> ParseResult<()>
Define the global value entity
.
sourcepub fn def_heap(&mut self, entity: Heap, loc: Location) -> ParseResult<()>
pub fn def_heap(&mut self, entity: Heap, loc: Location) -> ParseResult<()>
Define the heap entity
.
sourcepub fn def_table(&mut self, entity: Table, loc: Location) -> ParseResult<()>
pub fn def_table(&mut self, entity: Table, loc: Location) -> ParseResult<()>
Define the table entity
.
sourcepub fn def_sig(&mut self, entity: SigRef, loc: Location) -> ParseResult<()>
pub fn def_sig(&mut self, entity: SigRef, loc: Location) -> ParseResult<()>
Define the signature entity
.
sourcepub fn def_fn(&mut self, entity: FuncRef, loc: Location) -> ParseResult<()>
pub fn def_fn(&mut self, entity: FuncRef, loc: Location) -> ParseResult<()>
Define the external function entity
.
sourcepub fn def_jt(&mut self, entity: JumpTable, loc: Location) -> ParseResult<()>
pub fn def_jt(&mut self, entity: JumpTable, loc: Location) -> ParseResult<()>
Define the jump table entity
.
sourcepub fn def_constant(
&mut self,
entity: Constant,
loc: Location
) -> ParseResult<()>
pub fn def_constant(
&mut self,
entity: Constant,
loc: Location
) -> ParseResult<()>
Define the jump table entity
.
sourcepub fn def_entity(
&mut self,
entity: AnyEntity,
loc: Location
) -> ParseResult<()>
pub fn def_entity(
&mut self,
entity: AnyEntity,
loc: Location
) -> ParseResult<()>
Define an entity. This can be used for instructions whose numbers never appear in source, or implicitly defined signatures.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnwindSafe for SourceMap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more