Commit 570fd6e3 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

scripts: Remove special case for dynamic nodes from node generator.

new_ir_node() correctly handles oparity_dynamic.
parent 35c63680
......@@ -75,10 +75,9 @@ def format_curblock(node):
def format_insdecl(node):
arity = node.arity
if arity == "variable" and len(node.ins) == 0 or arity == "dynamic" or arity == 0:
return ""
if arity == "variable":
if arity == "dynamic" or arity == "variable":
if len(node.ins) == 0:
return ""
insarity = len(node.ins)
res = "int r_arity = arity + " + repr(insarity) + ";"
res += "\n\tir_node **r_in= ALLOCAN(ir_node*, r_arity);"
......@@ -87,6 +86,8 @@ def format_insdecl(node):
res += "\n\tr_in[" + repr(i) + "] = irn_" + input[0] + ";"
i += 1
res += "\n\tmemcpy(&r_in[" + repr(insarity) + "], in, sizeof(ir_node *) * arity);\n\t"
elif arity == 0:
return ""
else:
res = "ir_node *in[" + repr(arity) + "];"
i = 0
......@@ -97,9 +98,7 @@ def format_insdecl(node):
def format_arity_and_ins(node):
arity = node.arity
if arity == "dynamic":
return "-1, NULL"
elif arity == "variable":
if arity == "dynamic" or arity == "variable":
if len(node.ins) == 0:
return "arity, in"
else:
......
......@@ -65,11 +65,6 @@ ir_node *new_rd_{{node.name}}(
{%- endif %}
{{node|arity_and_ins}}
{% endfilter %});
{%- if node.arity == "dynamic" %}
for (int i = 0; i < arity; ++i) {
add_irn_n(res, in[i]);
}
{%- endif %}
{% if len(node.attrs) + len(node.initattrs) > 0 -%}
{% if spec.external -%}
{{node.attr_struct}} *attr = ({{node.attr_struct}}*) get_irn_generic_attr(res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment