Stop linking result values together.

Since results are in a value list, they don't need to form a linked
list any longer.

- Simplify make_inst_results() to create values in the natural order.
- Eliminate the last use of next_secondary_value().
- Delete unused result manipulation methods.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-12 12:54:11 -07:00
parent b9808bedc4
commit 00ee850e33
2 changed files with 33 additions and 259 deletions

View File

@@ -91,17 +91,10 @@ def unwrap_inst(iref, node, fmt):
for d in node.defs[1:]:
fmt.line('let src_{};'.format(d))
with fmt.indented('{', '}'):
fmt.line(
'src_{} = dfg.detach_secondary_results(inst).unwrap();'
.format(node.defs[1]))
for i in range(2, len(node.defs)):
fmt.line(
'src_{} = dfg.next_secondary_result(src_{})'
'.unwrap();'
.format(node.defs[i], node.defs[i - 1]))
fmt.line(
'assert_eq!(dfg.next_secondary_result(src_{}), None);'
.format(node.defs[-1]))
fmt.line('let r = dfg.inst_results(inst);')
for i in range(1, len(node.defs)):
fmt.line('src_{} = r[{}];'.format(node.defs[i], i))
fmt.line('dfg.detach_secondary_results(inst);')
for d in node.defs[1:]:
if d.has_free_typevar():
fmt.line(