Generalize def_inst() to def_entity().

Use this source map method for assigning a location to any entity whose
source number is not exposed. This could be

- Instructions.
- Signatures defined implicitly by function decls.

These entities only appear in the location map, not the entity number
maps.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-18 09:31:19 -07:00
parent a8a79df620
commit 45cf655ce4
2 changed files with 11 additions and 19 deletions

View File

@@ -837,7 +837,7 @@ impl<'a> Parser<'a> {
let inst = ctx.function.dfg.make_inst(inst_data);
let num_results = ctx.function.dfg.make_inst_results(inst, ctrl_typevar);
ctx.function.layout.append_inst(inst, ebb);
ctx.map.def_inst(inst, &opcode_loc).expect("duplicate inst references created");
ctx.map.def_entity(inst.into(), &opcode_loc).expect("duplicate inst references created");
if results.len() != num_results {
return err!(self.loc,