Remove some has_value_list workarounds.

Now that all variable_args formats use has_value_list, we can remove
some workarounds that allowed the old boxed_storage form.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-09 19:12:00 -08:00
parent 582a048089
commit cd06b176ac
2 changed files with 2 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ VARIABLE_ARGS = OperandKind(
passed to an extended basic block, or a variable number of results
returned from an instruction.
""",
default_member='varargs')
rust_type='&[Value]')
# Instances of immediate operand types are provided in the

View File

@@ -510,10 +510,7 @@ def gen_format_constructor(iform, fmt):
# Normal operand arguments.
for idx, kind in enumerate(iform.kinds):
if kind is cdsl.operands.VARIABLE_ARGS and iform.has_value_list:
args.append('op{}: &[Value]'.format(idx, kind.rust_type))
else:
args.append('op{}: {}'.format(idx, kind.rust_type))
args.append('op{}: {}'.format(idx, kind.rust_type))
proto = '{}({})'.format(iform.name, ', '.join(args))
proto += " -> (Inst, &'f mut DataFlowGraph)"
@@ -575,8 +572,6 @@ def gen_member_inits(iform, fmt):
# Immediates and entity references.
for idx, member in enumerate(iform.members):
if iform.has_value_list and member == 'varargs':
continue
if member:
fmt.line('{}: op{},'.format(member, idx))
@@ -606,9 +601,6 @@ def gen_inst_builder(inst, fmt):
t = 'T{}{}'.format(1 + len(tmpl_types), op.kind.name)
tmpl_types.append('{}: Into<{}>'.format(t, op.kind.rust_type))
into_args.append(op.name)
elif (inst.format.has_value_list and
op.kind is cdsl.operands.VARIABLE_ARGS):
t = '&[Value]'
else:
t = op.kind.rust_type
args.append('{}: {}'.format(op.name, t))