From cd06b176ac99036d222470ea197b1033df9c8780 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 9 Mar 2017 19:12:00 -0800 Subject: [PATCH] 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. --- lib/cretonne/meta/cdsl/operands.py | 2 +- lib/cretonne/meta/gen_instr.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/cretonne/meta/cdsl/operands.py b/lib/cretonne/meta/cdsl/operands.py index f7ec85eafa..277f2597b0 100644 --- a/lib/cretonne/meta/cdsl/operands.py +++ b/lib/cretonne/meta/cdsl/operands.py @@ -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 diff --git a/lib/cretonne/meta/gen_instr.py b/lib/cretonne/meta/gen_instr.py index 376bfc0d56..b452daff2e 100644 --- a/lib/cretonne/meta/gen_instr.py +++ b/lib/cretonne/meta/gen_instr.py @@ -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))