Commit a0d23aec authored by Christoph Mallon's avatar Christoph Mallon
Browse files

irspec: Turn the negative flag customSerializer into a positive one called serializer.

parent 2572875e
...@@ -200,18 +200,18 @@ class Deleted: ...@@ -200,18 +200,18 @@ class Deleted:
@op @op
class Block: class Block:
"""A basic block""" """A basic block"""
mode = "mode_BB" mode = "mode_BB"
block = "NULL" block = "NULL"
pinned = "yes" pinned = "yes"
arity = "variable" arity = "variable"
input_name = "cfgpred" input_name = "cfgpred"
flags = [] flags = []
attr_struct = "block_attr" attr_struct = "block_attr"
attrs = [ attrs = [
Attribute("entity", type="ir_entity*", init="NULL", Attribute("entity", type="ir_entity*", init="NULL",
comment="entity representing this block"), comment="entity representing this block"),
] ]
customSerializer = True serializer = False
init = ''' init = '''
res->attr.block.backedge = new_backedge_arr(get_irg_obstack(irg), arity); res->attr.block.backedge = new_backedge_arr(get_irg_obstack(irg), arity);
...@@ -633,18 +633,18 @@ class Phi: ...@@ -633,18 +633,18 @@ class Phi:
"""Choose a value based on control flow. A phi node has 1 input for each """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 predecessor of its block. If a block is entered from its nth predecessor
all phi nodes produce their nth input as result.""" all phi nodes produce their nth input as result."""
pinned = "yes" pinned = "yes"
arity = "variable" arity = "variable"
input_name = "pred" input_name = "pred"
flags = [] flags = []
attrs = [ attrs = [
Attribute("loop", type="int", init="0", Attribute("loop", type="int", init="0",
comment="wether Phi represents the observable effect of a (possibly) nonterminating loop"), comment="wether Phi represents the observable effect of a (possibly) nonterminating loop"),
] ]
attr_struct = "phi_attr" attr_struct = "phi_attr"
init = ''' init = '''
res->attr.phi.u.backedge = new_backedge_arr(get_irg_obstack(irg), arity);''' res->attr.phi.u.backedge = new_backedge_arr(get_irg_obstack(irg), arity);'''
customSerializer = True serializer = False
@op @op
class Pin: class Pin:
......
...@@ -106,7 +106,7 @@ def setnodedefaults(node): ...@@ -106,7 +106,7 @@ def setnodedefaults(node):
setdefault(node, "attrs", []) setdefault(node, "attrs", [])
setdefault(node, "constructor", True) setdefault(node, "constructor", True)
setdefault(node, "constructor_args", []) setdefault(node, "constructor_args", [])
setdefault(node, "customSerializer", not node.constructor) setdefault(node, "serializer", node.constructor)
setdefault(node, "block", None) setdefault(node, "block", None)
if hasattr(node, "__doc__"): if hasattr(node, "__doc__"):
node.doc = trim_docstring(node.__doc__) node.doc = trim_docstring(node.__doc__)
......
{{warning}} {{warning}}
{%- for node in nodes|hasnot('customSerializer') %} {%- for node in nodes|has('serializer') %}
static ir_node *read_{{node.name}}(read_env_t *env) static ir_node *read_{{node.name}}(read_env_t *env)
{ {
{%- if not node.block %} {%- if not node.block %}
...@@ -63,7 +63,7 @@ static ir_node *read_{{node.name}}(read_env_t *env) ...@@ -63,7 +63,7 @@ static ir_node *read_{{node.name}}(read_env_t *env)
} }
{% endfor %} {% endfor %}
{%- for node in nodes|hasnot('customSerializer') %} {%- for node in nodes|has('serializer') %}
static void write_{{node.name}}(write_env_t *env, const ir_node *node) static void write_{{node.name}}(write_env_t *env, const ir_node *node)
{ {
write_symbol(env, "{{node.name}}"); write_symbol(env, "{{node.name}}");
...@@ -94,14 +94,14 @@ static void write_{{node.name}}(write_env_t *env, const ir_node *node) ...@@ -94,14 +94,14 @@ static void write_{{node.name}}(write_env_t *env, const ir_node *node)
static void register_generated_node_readers(void) static void register_generated_node_readers(void)
{ {
{%- for node in nodes|hasnot('customSerializer') %} {%- for node in nodes|has('serializer') %}
register_node_reader("{{node.name}}", read_{{node.name}}); register_node_reader("{{node.name}}", read_{{node.name}});
{%- endfor %} {%- endfor %}
} }
static void register_generated_node_writers(void) static void register_generated_node_writers(void)
{ {
{%- for node in nodes|hasnot('customSerializer') %} {%- for node in nodes|has('serializer') %}
register_node_writer(op_{{node.name}}, write_{{node.name}}); register_node_writer(op_{{node.name}}, write_{{node.name}});
{%- endfor %} {%- endfor %}
} }
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