Add an Index<Value> implementation to Liveness.

Use it to access live ranges that are supposed to be there.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-29 15:13:04 -07:00
parent 3fbcdb4ea6
commit 51dcabd87c
4 changed files with 17 additions and 12 deletions

View File

@@ -260,10 +260,7 @@ impl LiveValueTracker {
// Add the values defined by `inst`.
let first_def = self.live.values.len();
for &value in dfg.inst_results(inst) {
let lr = match liveness.get(value) {
Some(lr) => lr,
None => panic!("{} result {} has no live range", dfg[inst].opcode(), value),
};
let lr = &liveness[value];
assert_eq!(lr.def(), inst.into());
match lr.def_local_end().into() {
ExpandedProgramPoint::Inst(endpoint) => {