Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
570fd6e3
Commit
570fd6e3
authored
Nov 01, 2014
by
Christoph Mallon
Browse files
scripts: Remove special case for dynamic nodes from node generator.
new_ir_node() correctly handles oparity_dynamic.
parent
35c63680
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/gen_ir.py
View file @
570fd6e3
...
...
@@ -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\t
ir_node **r_in= ALLOCAN(ir_node*, r_arity);"
...
...
@@ -87,6 +86,8 @@ def format_insdecl(node):
res
+=
"
\n\t
r_in["
+
repr
(
i
)
+
"] = irn_"
+
input
[
0
]
+
";"
i
+=
1
res
+=
"
\n\t
memcpy(&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
:
...
...
scripts/templates/gen_irnode.c
View file @
570fd6e3
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment