Clean up more comments referring to "source numbers".

This commit is contained in:
Dan Gohman
2018-02-20 14:44:05 -08:00
parent 10dcfcacdb
commit 69cc6c8af3
2 changed files with 8 additions and 10 deletions

View File

@@ -1735,8 +1735,6 @@ impl<'a> Parser<'a> {
// The controlling type variable can be specified explicitly as 'splat.i32x4 v5', or it can be // The controlling type variable can be specified explicitly as 'splat.i32x4 v5', or it can be
// inferred from `inst_data.typevar_operand` for some opcodes. // inferred from `inst_data.typevar_operand` for some opcodes.
// //
// The value operands in `inst_data` are expected to use source numbering.
//
// Returns the controlling typevar for a polymorphic opcode, or `VOID` for a non-polymorphic // Returns the controlling typevar for a polymorphic opcode, or `VOID` for a non-polymorphic
// opcode. // opcode.
fn infer_typevar( fn infer_typevar(

View File

@@ -21,42 +21,42 @@ pub struct SourceMap {
/// Read-only interface which is exposed outside the parser crate. /// Read-only interface which is exposed outside the parser crate.
impl SourceMap { impl SourceMap {
/// Look up a value entity by its source number. /// Look up a value entity.
pub fn contains_value(&self, v: Value) -> bool { pub fn contains_value(&self, v: Value) -> bool {
self.locations.contains_key(&v.into()) self.locations.contains_key(&v.into())
} }
/// Look up a EBB entity by its source number. /// Look up a EBB entity.
pub fn contains_ebb(&self, ebb: Ebb) -> bool { pub fn contains_ebb(&self, ebb: Ebb) -> bool {
self.locations.contains_key(&ebb.into()) self.locations.contains_key(&ebb.into())
} }
/// Look up a stack slot entity by its source number. /// Look up a stack slot entity.
pub fn contains_ss(&self, ss: StackSlot) -> bool { pub fn contains_ss(&self, ss: StackSlot) -> bool {
self.locations.contains_key(&ss.into()) self.locations.contains_key(&ss.into())
} }
/// Look up a global variable entity by its source number. /// Look up a global variable entity.
pub fn contains_gv(&self, gv: GlobalVar) -> bool { pub fn contains_gv(&self, gv: GlobalVar) -> bool {
self.locations.contains_key(&gv.into()) self.locations.contains_key(&gv.into())
} }
/// Look up a heap entity by its source number. /// Look up a heap entity.
pub fn contains_heap(&self, heap: Heap) -> bool { pub fn contains_heap(&self, heap: Heap) -> bool {
self.locations.contains_key(&heap.into()) self.locations.contains_key(&heap.into())
} }
/// Look up a signature entity by its source number. /// Look up a signature entity.
pub fn contains_sig(&self, sig: SigRef) -> bool { pub fn contains_sig(&self, sig: SigRef) -> bool {
self.locations.contains_key(&sig.into()) self.locations.contains_key(&sig.into())
} }
/// Look up a function entity by its source number. /// Look up a function entity.
pub fn contains_fn(&self, fn_: FuncRef) -> bool { pub fn contains_fn(&self, fn_: FuncRef) -> bool {
self.locations.contains_key(&fn_.into()) self.locations.contains_key(&fn_.into())
} }
/// Look up a jump table entity by its source number. /// Look up a jump table entity.
pub fn contains_jt(&self, jt: JumpTable) -> bool { pub fn contains_jt(&self, jt: JumpTable) -> bool {
self.locations.contains_key(&jt.into()) self.locations.contains_key(&jt.into())
} }