Convert return formats to value lists.

With the Return and ReturnReg formats converted to using value lists for
storing their arguments, thee are no remaining instruction formats with
variable argument lists in boxed storage.

The Return and ReturnReg formats are also going to be merged since
they are identical now.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-09 15:56:33 -08:00
parent 1135a89af9
commit 582a048089
6 changed files with 25 additions and 53 deletions

View File

@@ -282,19 +282,19 @@ fn write_instruction(w: &mut Write,
args[0],
DisplayValues(&args[1..]))
}
Return { ref data, .. } => {
if data.varargs.is_empty() {
Return { ref args, .. } => {
if args.is_empty() {
writeln!(w, "")
} else {
writeln!(w, " {}", data.varargs)
writeln!(w,
" {}",
DisplayValues(args.as_slice(&func.dfg.value_lists)))
}
}
ReturnReg { ref data, .. } => {
if data.varargs.is_empty() {
writeln!(w, " {}", data.arg)
} else {
writeln!(w, " {}, {}", data.arg, data.varargs)
}
ReturnReg { ref args, .. } => {
writeln!(w,
" {}",
DisplayValues(args.as_slice(&func.dfg.value_lists)))
}
}
}