Keep EBB arguments in a ValueList.

This is the first step of the value list refactoring which will replace
linked lists of values with value lists.

- Keep a ValueList in the EbbData struct containing all the EBB
  arguments.
- Change dfg.ebb_args() to return a slice instead of an iterator.

This leaves us in a temporary hybrid state where we maintain both a
linked list and a ValueList vector of the EBB arguments.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-11 11:36:50 -07:00
parent 4ee519e620
commit dd0a61cc91
6 changed files with 40 additions and 48 deletions

View File

@@ -1895,13 +1895,12 @@ mod tests {
let mut ebbs = func.layout.ebbs();
let ebb0 = ebbs.next().unwrap();
assert_eq!(func.dfg.ebb_args(ebb0).next(), None);
assert_eq!(func.dfg.ebb_args(ebb0), &[]);
let ebb4 = ebbs.next().unwrap();
let mut ebb4_args = func.dfg.ebb_args(ebb4);
let arg0 = ebb4_args.next().unwrap();
assert_eq!(func.dfg.value_type(arg0), types::I32);
assert_eq!(ebb4_args.next(), None);
let ebb4_args = func.dfg.ebb_args(ebb4);
assert_eq!(ebb4_args.len(), 1);
assert_eq!(func.dfg.value_type(ebb4_args[0]), types::I32);
}
#[test]