Print value aliases at referrent definition (#492)

* Print value aliases at referrent definition

Closes #488.
This commit is contained in:
Kaz Wesley
2018-09-04 15:02:46 -07:00
committed by Dan Gohman
parent 4045d50b7b
commit 7e571f4a49
4 changed files with 131 additions and 24 deletions

View File

@@ -1688,7 +1688,7 @@ impl<'a> Parser<'a> {
// Allow duplicate definitions of aliases, as long as they are identical.
if ctx.map.contains_value(result) {
if let Some(old) = ctx.function.dfg.value_alias_dest_for_parser(result) {
if let Some(old) = ctx.function.dfg.value_alias_dest_for_serialization(result) {
if old != dest {
return err!(
self.loc,
@@ -1708,7 +1708,9 @@ impl<'a> Parser<'a> {
return err!(self.loc, "value {} is not yet defined", dest);
}
ctx.function.dfg.make_value_alias_for_parser(dest, result);
ctx.function
.dfg
.make_value_alias_for_serialization(dest, result);
ctx.aliases.push(result);
Ok(())