Struct cranelift_reader::SourceMap
source · pub struct SourceMap { /* private fields */ }
Expand description
Mapping from entity names to source locations.
Implementations§
source§impl 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_dss(&self, dss: DynamicStackSlot) -> bool
pub fn contains_dss(&self, dss: DynamicStackSlot) -> bool
Look up a dynamic 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_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.
source§impl 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_dss(
&mut self,
entity: DynamicStackSlot,
loc: Location
) -> ParseResult<()>
pub fn def_dss( &mut self, entity: DynamicStackSlot, loc: Location ) -> ParseResult<()>
Define the dynamic stack slot entity
.
sourcepub fn def_dt(&mut self, entity: DynamicType, loc: Location) -> ParseResult<()>
pub fn def_dt(&mut self, entity: DynamicType, loc: Location) -> ParseResult<()>
Define the dynamic type 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_mt(&mut self, entity: MemoryType, loc: Location) -> ParseResult<()>
pub fn def_mt(&mut self, entity: MemoryType, loc: Location) -> ParseResult<()>
Define the memory type 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.