Make value aliases during references rewriting

This commit is contained in:
Keith Yeung
2017-01-17 01:17:29 -08:00
committed by Jakob Stoklund Olesen
parent 8e38c7907d
commit d93c37a826
2 changed files with 31 additions and 0 deletions

View File

@@ -234,6 +234,19 @@ impl DataFlowGraph {
panic!("Cannot change direct value {} into an alias", dest);
}
}
/// Create a new value alias.
///
/// Note that this function should only be called by the parser.
pub fn make_value_alias(&mut self, src: Value) -> Value {
let ty = self.value_type(src);
let data = ValueData::Alias {
ty: ty,
original: src,
};
self.make_value(data)
}
}
/// Where did a value come from?