Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
eaad966e
Commit
eaad966e
authored
Apr 01, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move parallel deletion flatten into PostParseTransform
parent
6a57acd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-15
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+14
-0
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+1
-1
No files found.
Cython/Compiler/Nodes.py
View file @
eaad966e
...
...
@@ -3784,23 +3784,12 @@ class DelStatNode(StatNode):
child_attrs
=
[
"args"
]
def
flatten_args
(
self
):
return
self
.
_flatten_args
(
self
,
[])
def
_flatten_args
(
self
,
seq
,
result
):
for
arg
in
seq
.
args
:
if
arg
.
is_sequence_constructor
:
self
.
_flatten_args
(
arg
,
result
)
else
:
result
.
append
(
arg
)
return
result
def
analyse_declarations
(
self
,
env
):
for
arg
in
self
.
flatten_args
()
:
for
arg
in
self
.
args
:
arg
.
analyse_target_declaration
(
env
)
def
analyse_expressions
(
self
,
env
):
for
arg
in
self
.
flatten_args
()
:
for
arg
in
self
.
args
:
arg
.
analyse_target_expression
(
env
,
None
)
if
arg
.
type
.
is_pyobject
:
pass
...
...
@@ -3813,14 +3802,14 @@ class DelStatNode(StatNode):
#arg.release_target_temp(env)
def
nogil_check
(
self
,
env
):
for
arg
in
self
.
flatten_args
()
:
for
arg
in
self
.
args
:
if
arg
.
type
.
is_pyobject
:
self
.
gil_error
()
gil_message
=
"Deleting Python object"
def
generate_execution_code
(
self
,
code
):
for
arg
in
self
.
flatten_args
()
:
for
arg
in
self
.
args
:
if
arg
.
type
.
is_pyobject
:
arg
.
generate_deletion_code
(
code
)
elif
arg
.
type
.
is_ptr
and
arg
.
type
.
base_type
.
is_cpp_class
:
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
eaad966e
...
...
@@ -299,6 +299,20 @@ class PostParse(ScopeTrackingTransform):
return
assign_node
def
_flatten_sequence
(
self
,
seq
,
result
):
for
arg
in
seq
.
args
:
if
arg
.
is_sequence_constructor
:
self
.
_flatten_sequence
(
arg
,
result
)
else
:
result
.
append
(
arg
)
return
result
def
visit_DelStatNode
(
self
,
node
):
self
.
visitchildren
(
node
)
node
.
args
=
self
.
_flatten_sequence
(
node
,
[])
return
node
def
eliminate_rhs_duplicates
(
expr_list_list
,
ref_node_sequence
):
"""Replace rhs items by LetRefNodes if they appear more than once.
Creates a sequence of LetRefNodes that set up the required temps
...
...
Cython/Compiler/TypeInference.py
View file @
eaad966e
...
...
@@ -122,7 +122,7 @@ class MarkAssignments(CythonTransform):
return
node
def
visit_DelStatNode
(
self
,
node
):
for
arg
in
node
.
flatten_args
()
:
for
arg
in
node
.
args
:
self
.
mark_assignment
(
arg
,
arg
)
self
.
visitchildren
(
node
)
return
node
...
...
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