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
f6cb1da9
Commit
f6cb1da9
authored
Nov 18, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid calling TupleNode.allocate_temps() in iter-dict transform
parent
87c39bdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+12
-16
No files found.
Cython/Compiler/Optimize.py
View file @
f6cb1da9
...
...
@@ -51,7 +51,6 @@ class DictIterTransform(Visitor.VisitorTransform):
return
node
dict_obj
=
function
.
obj
method
=
function
.
attribute
env
=
self
.
env_stack
[
-
1
]
keys
=
values
=
False
if
method
==
'iterkeys'
:
...
...
@@ -121,12 +120,20 @@ class DictIterTransform(Visitor.VisitorTransform):
stats
=
[
node
.
body
])
if
tuple_target
:
tuple_result
=
ExprNodes
.
TupleNode
(
temp
=
UtilNodes
.
TempHandle
(
py_object_ptr
)
temps
.
append
(
temp
)
temp_tuple
=
temp
.
ref
(
tuple_target
.
pos
)
class
TempTupleNode
(
ExprNodes
.
TupleNode
):
# FIXME: remove this after result-code refactoring
def
result
(
self
):
return
temp_tuple
.
result
()
tuple_result
=
TempTupleNode
(
pos
=
tuple_target
.
pos
,
args
=
[
key_cast
,
value_cast
]
args
=
[
key_cast
,
value_cast
],
is_temp
=
1
,
type
=
Builtin
.
tuple_type
,
)
tuple_result
.
analyse_types
(
env
)
tuple_result
.
allocate_temps
(
env
)
body
.
stats
.
insert
(
0
,
Nodes
.
SingleAssignmentNode
(
pos
=
tuple_target
.
pos
,
lhs
=
tuple_target
,
...
...
@@ -174,17 +181,6 @@ class DictIterTransform(Visitor.VisitorTransform):
stats
=
result_code
))
def
visit_ModuleNode
(
self
,
node
):
self
.
env_stack
=
[
node
.
scope
]
self
.
visitchildren
(
node
)
return
node
def
visit_FuncDefNode
(
self
,
node
):
self
.
env_stack
.
append
(
node
.
local_scope
)
self
.
visitchildren
(
node
)
self
.
env_stack
.
pop
()
return
node
def
visit_Node
(
self
,
node
):
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