Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
a0d23aec
Commit
a0d23aec
authored
Dec 27, 2014
by
Christoph Mallon
Browse files
irspec: Turn the negative flag customSerializer into a positive one called serializer.
parent
2572875e
Changes
3
Hide whitespace changes
Inline
Side-by-side
scripts/ir_spec.py
View file @
a0d23aec
...
...
@@ -200,18 +200,18 @@ class Deleted:
@
op
class
Block
:
"""A basic block"""
mode
=
"mode_BB"
block
=
"NULL"
pinned
=
"yes"
arity
=
"variable"
input_name
=
"cfgpred"
flags
=
[]
attr_struct
=
"block_attr"
attrs
=
[
mode
=
"mode_BB"
block
=
"NULL"
pinned
=
"yes"
arity
=
"variable"
input_name
=
"cfgpred"
flags
=
[]
attr_struct
=
"block_attr"
attrs
=
[
Attribute
(
"entity"
,
type
=
"ir_entity*"
,
init
=
"NULL"
,
comment
=
"entity representing this block"
),
]
customS
erializer
=
Tru
e
s
erializer
=
Fals
e
init
=
'''
res->attr.block.backedge = new_backedge_arr(get_irg_obstack(irg), arity);
...
...
@@ -633,18 +633,18 @@ class Phi:
"""Choose a value based on control flow. A phi node has 1 input for each
predecessor of its block. If a block is entered from its nth predecessor
all phi nodes produce their nth input as result."""
pinned
=
"yes"
arity
=
"variable"
input_name
=
"pred"
flags
=
[]
attrs
=
[
pinned
=
"yes"
arity
=
"variable"
input_name
=
"pred"
flags
=
[]
attrs
=
[
Attribute
(
"loop"
,
type
=
"int"
,
init
=
"0"
,
comment
=
"wether Phi represents the observable effect of a (possibly) nonterminating loop"
),
]
attr_struct
=
"phi_attr"
init
=
'''
attr_struct
=
"phi_attr"
init
=
'''
res->attr.phi.u.backedge = new_backedge_arr(get_irg_obstack(irg), arity);'''
customS
erializer
=
Tru
e
s
erializer
=
Fals
e
@
op
class
Pin
:
...
...
scripts/spec_util.py
View file @
a0d23aec
...
...
@@ -106,7 +106,7 @@ def setnodedefaults(node):
setdefault
(
node
,
"attrs"
,
[])
setdefault
(
node
,
"constructor"
,
True
)
setdefault
(
node
,
"constructor_args"
,
[])
setdefault
(
node
,
"
customS
erializer"
,
not
node
.
constructor
)
setdefault
(
node
,
"
s
erializer"
,
node
.
constructor
)
setdefault
(
node
,
"block"
,
None
)
if
hasattr
(
node
,
"__doc__"
):
node
.
doc
=
trim_docstring
(
node
.
__doc__
)
...
...
scripts/templates/gen_irio.c.inl
View file @
a0d23aec
{{warning}}
{%- for node in nodes|has
not('customS
erializer') %}
{%- for node in nodes|has
('s
erializer') %}
static ir_node *read_{{node.name}}(read_env_t *env)
{
{%- if not node.block %}
...
...
@@ -63,7 +63,7 @@ static ir_node *read_{{node.name}}(read_env_t *env)
}
{% endfor %}
{%- for node in nodes|has
not('customS
erializer') %}
{%- for node in nodes|has
('s
erializer') %}
static void write_{{node.name}}(write_env_t *env, const ir_node *node)
{
write_symbol(env, "{{node.name}}");
...
...
@@ -94,14 +94,14 @@ static void write_{{node.name}}(write_env_t *env, const ir_node *node)
static void register_generated_node_readers(void)
{
{%- for node in nodes|has
not('customS
erializer') %}
{%- for node in nodes|has
('s
erializer') %}
register_node_reader("{{node.name}}", read_{{node.name}});
{%- endfor %}
}
static void register_generated_node_writers(void)
{
{%- for node in nodes|has
not('customS
erializer') %}
{%- for node in nodes|has
('s
erializer') %}
register_node_writer(op_{{node.name}}, write_{{node.name}});
{%- endfor %}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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