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
7a594c85
Commit
7a594c85
authored
Sep 22, 2010
by
Matthias Braun
Browse files
node generator: don't create pn_ and n_ enums if there are no members
[r28015]
parent
1a3a33b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/scripts/generate_new_opcodes.pl
View file @
7a594c85
...
...
@@ -530,18 +530,20 @@ foreach my $op (keys(%nodes)) {
$num_outs
=
$#outs
+
1
;
$obst_proj
.=
"
\n
enum pn_
${op}
{
\n
";
for
(
my
$idx
=
0
;
$idx
<=
$#outs
;
$idx
++
)
{
# check, if we have additional flags annotated to out
if
(
$outs
[
$idx
]
=~
/:((S|I)(\|(S|I))*)/
)
{
push
(
@out_flags
,
$
1
);
$outs
[
$idx
]
=~
s/:((S|I)(\|(S|I))*)//
;
if
(
$num_outs
>
0
)
{
$obst_proj
.=
"
\n
enum pn_
${op}
{
\n
";
for
(
my
$idx
=
0
;
$idx
<=
$#outs
;
$idx
++
)
{
# check, if we have additional flags annotated to out
if
(
$outs
[
$idx
]
=~
/:((S|I)(\|(S|I))*)/
)
{
push
(
@out_flags
,
$
1
);
$outs
[
$idx
]
=~
s/:((S|I)(\|(S|I))*)//
;
}
$obst_proj
.=
"
\t
pn_
${op}
_
"
.
$outs
[
$idx
]
.
"
=
${idx}
,
\n
";
}
$obst_proj
.=
"
\t
pn_
${op}
_
"
.
$outs
[
$idx
]
.
"
=
${idx}
,
\n
";
}
$obst_proj
.=
"
};
\n
";
$obst_proj
.=
"
};
\n
";
}
# outs have names, it must be a mode_T node
if
(
!
defined
(
$n
{
mode
}))
{
$n
{
mode
}
=
"
mode_T
";
...
...
@@ -555,11 +557,13 @@ foreach my $op (keys(%nodes)) {
die
"
Fatal error: Op
${op}
has different number of ins and arity
\n
";
}
$obst_proj
.=
"
\n
enum n_
$op
{
\n
";
for
(
my
$idx
=
0
;
$idx
<=
$#ins
;
$idx
++
)
{
$obst_proj
.=
"
\t
n_
${op}
_
"
.
$ins
[
$idx
]
.
"
=
${idx}
,
\n
";
if
(
$#ins
>=
0
)
{
$obst_proj
.=
"
\n
enum n_
$op
{
\n
";
for
(
my
$idx
=
0
;
$idx
<=
$#ins
;
$idx
++
)
{
$obst_proj
.=
"
\t
n_
${op}
_
"
.
$ins
[
$idx
]
.
"
=
${idx}
,
\n
";
}
$obst_proj
.=
"
};
\n
";
}
$obst_proj
.=
"
};
\n
";
}
# Create opcode
...
...
Write
Preview
Supports
Markdown
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