Remove layout::Cursor from the legalizer::split API.

We still use the cursor internally, but don't require callers to use it
too.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-21 13:06:28 -07:00
parent 1cd91b6f30
commit 8e93aa7ce7
4 changed files with 39 additions and 26 deletions

View File

@@ -264,12 +264,12 @@ def emit_dst_inst(node, fmt):
# Split instructions are not emitted with the builder, but by calling
# special functions in the `legalizer::split` module. These functions
# will eliminate concat-split patterns.
fmt.line(
'let {} = split::{}(dfg, cfg, pos, {});'
.format(
wrap_tup(node.defs),
node.expr.inst.snake_name(),
node.expr.args[0]))
fmt.line('let curpos = pos.position();')
fmt.format(
'let {} = split::{}(dfg, pos.layout, cfg, curpos, {});',
wrap_tup(node.defs),
node.expr.inst.snake_name(),
node.expr.args[0])
else:
if len(node.defs) == 0:
# This node doesn't define any values, so just insert the new