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
512cb109
Commit
512cb109
authored
Sep 15, 2014
by
Matthias Braun
Browse files
automatically set block in spec when start_block flag is set
parent
a41c9203
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/ir_spec.py
View file @
512cb109
...
@@ -27,7 +27,6 @@ class EntConst(object):
...
@@ -27,7 +27,6 @@ class EntConst(object):
"""Symbolic constant that represents an aspect of an entity"""
"""Symbolic constant that represents an aspect of an entity"""
name
=
"entconst"
name
=
"entconst"
flags
=
[
"constlike"
,
"start_block"
]
flags
=
[
"constlike"
,
"start_block"
]
block
=
"get_irg_start_block(irg)"
pinned
=
"no"
pinned
=
"no"
attrs
=
[
attrs
=
[
Attribute
(
"entity"
,
type
=
"ir_entity*"
,
comment
=
"entity to operate on"
),
Attribute
(
"entity"
,
type
=
"ir_entity*"
,
comment
=
"entity to operate on"
),
...
@@ -41,7 +40,6 @@ class TypeConst(object):
...
@@ -41,7 +40,6 @@ class TypeConst(object):
"""A symbolic constant that represents an aspect of a type"""
"""A symbolic constant that represents an aspect of a type"""
name
=
"typeconst"
name
=
"typeconst"
flags
=
[
"constlike"
,
"start_block"
]
flags
=
[
"constlike"
,
"start_block"
]
block
=
"get_irg_start_block(irg)"
pinned
=
"no"
pinned
=
"no"
attrs
=
[
attrs
=
[
Attribute
(
"type"
,
type
=
"ir_type*"
,
comment
=
"type to operate on"
),
Attribute
(
"type"
,
type
=
"ir_type*"
,
comment
=
"type to operate on"
),
...
@@ -186,7 +184,6 @@ class Bad:
...
@@ -186,7 +184,6 @@ class Bad:
from undefined behaviour like reading uninitialized local variables in C."""
from undefined behaviour like reading uninitialized local variables in C."""
flags
=
[
"start_block"
,
"dump_noblock"
]
flags
=
[
"start_block"
,
"dump_noblock"
]
pinned
=
"yes"
pinned
=
"yes"
block
=
"get_irg_start_block(irg)"
attr_struct
=
"bad_attr"
attr_struct
=
"bad_attr"
init
=
'''
init
=
'''
res->attr.bad.irg.irg = irg;
res->attr.bad.irg.irg = irg;
...
@@ -366,7 +363,6 @@ class Confirm:
...
@@ -366,7 +363,6 @@ class Confirm:
class
Const
:
class
Const
:
"""Returns a constant value."""
"""Returns a constant value."""
flags
=
[
"constlike"
,
"start_block"
]
flags
=
[
"constlike"
,
"start_block"
]
block
=
"get_irg_start_block(irg)"
mode
=
"get_tarval_mode(tarval)"
mode
=
"get_tarval_mode(tarval)"
pinned
=
"no"
pinned
=
"no"
attrs
=
[
attrs
=
[
...
@@ -453,7 +449,6 @@ class Dummy:
...
@@ -453,7 +449,6 @@ class Dummy:
ins
=
[]
ins
=
[]
flags
=
[
"cfopcode"
,
"start_block"
,
"constlike"
,
"dump_noblock"
]
flags
=
[
"cfopcode"
,
"start_block"
,
"constlike"
,
"dump_noblock"
]
pinned
=
"yes"
pinned
=
"yes"
block
=
"get_irg_start_block(irg)"
@
op
@
op
class
End
:
class
End
:
...
@@ -620,7 +615,6 @@ class NoMem:
...
@@ -620,7 +615,6 @@ class NoMem:
mode
=
"mode_M"
mode
=
"mode_M"
flags
=
[
"dump_noblock"
,
"start_block"
]
flags
=
[
"dump_noblock"
,
"start_block"
]
pinned
=
"yes"
pinned
=
"yes"
block
=
"get_irg_start_block(irg)"
singleton
=
True
singleton
=
True
@
op
@
op
...
@@ -792,9 +786,8 @@ class Start:
...
@@ -792,9 +786,8 @@ class Start:
]
]
mode
=
"mode_T"
mode
=
"mode_T"
pinned
=
"yes"
pinned
=
"yes"
flags
=
[
"cfopcode"
]
flags
=
[
"cfopcode"
,
"start_block"
]
singleton
=
True
singleton
=
True
block
=
"get_irg_start_block(irg)"
@
op
@
op
class
Store
:
class
Store
:
...
@@ -876,5 +869,4 @@ class Unknown:
...
@@ -876,5 +869,4 @@ class Unknown:
Unknown+x or Unknown<x with a new Unknown node if there are multiple
Unknown+x or Unknown<x with a new Unknown node if there are multiple
users of the original unknown node!"""
users of the original unknown node!"""
pinned
=
"yes"
pinned
=
"yes"
block
=
"get_irg_start_block(irg)"
flags
=
[
"start_block"
,
"constlike"
,
"dump_noblock"
]
flags
=
[
"start_block"
,
"constlike"
,
"dump_noblock"
]
scripts/spec_util.py
View file @
512cb109
...
@@ -92,13 +92,15 @@ def setnodedefaults(node):
...
@@ -92,13 +92,15 @@ def setnodedefaults(node):
setdefault
(
node
,
"constructor_args"
,
[])
setdefault
(
node
,
"constructor_args"
,
[])
setdefault
(
node
,
"customSerializer"
,
False
)
setdefault
(
node
,
"customSerializer"
,
False
)
setdefault
(
node
,
"block"
,
None
)
setdefault
(
node
,
"block"
,
None
)
setdefault
(
node
,
"usesGraph"
,
node
.
block
!=
None
)
if
hasattr
(
node
,
"__doc__"
):
if
hasattr
(
node
,
"__doc__"
):
node
.
doc
=
trim_docstring
(
node
.
__doc__
)
node
.
doc
=
trim_docstring
(
node
.
__doc__
)
else
:
else
:
node
.
doc
=
""
node
.
doc
=
""
if
hasattr
(
node
,
"outs"
):
if
hasattr
(
node
,
"outs"
):
node
.
mode
=
"mode_T"
node
.
mode
=
"mode_T"
if
"start_block"
in
node
.
flags
:
node
.
block
=
"get_irg_start_block(irg)"
setdefault
(
node
,
"usesGraph"
,
node
.
block
!=
None
)
def
load_spec
(
filename
):
def
load_spec
(
filename
):
module
=
imp
.
load_source
(
'spec'
,
filename
)
module
=
imp
.
load_source
(
'spec'
,
filename
)
...
...
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