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 1c890f317d
commit ccba325b6c
6 changed files with 40 additions and 48 deletions

View File

@@ -151,7 +151,7 @@ impl<'a> Verifier<'a> {
}
// Arguments belong to the correct ebb.
for arg in self.func.dfg.ebb_args(ebb) {
for &arg in self.func.dfg.ebb_args(ebb) {
match self.func.dfg.value_def(arg) {
ValueDef::Arg(arg_ebb, _) => {
if ebb != arg_ebb {
@@ -405,7 +405,7 @@ impl<'a> Verifier<'a> {
return err!(ebb, "entry block arguments must match function signature");
}
for (i, arg) in self.func.dfg.ebb_args(ebb).enumerate() {
for (i, &arg) in self.func.dfg.ebb_args(ebb).iter().enumerate() {
let arg_type = self.func.dfg.value_type(arg);
if arg_type != expected_types[i].value_type {
return err!(ebb,
@@ -510,7 +510,8 @@ impl<'a> Verifier<'a> {
let iter = self.func
.dfg
.ebb_args(ebb)
.map(|v| self.func.dfg.value_type(v));
.iter()
.map(|&v| self.func.dfg.value_type(v));
self.typecheck_variable_args_iterator(inst, iter)?;
}
BranchInfo::Table(table) => {