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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
571e3b08
Commit
571e3b08
authored
Nov 27, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix iterdict transform for new temp semantics
parent
fcfaa416
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+11
-8
No files found.
Cython/Compiler/Optimize.py
View file @
571e3b08
...
...
@@ -76,7 +76,7 @@ class DictIterTransform(Visitor.VisitorTransform):
dict_temp
=
temp
.
ref
(
dict_obj
.
pos
)
temp
=
UtilNodes
.
TempHandle
(
PyrexTypes
.
c_py_ssize_t_type
)
temps
.
append
(
temp
)
pos_temp
=
temp
.
ref
(
dict_obj
.
pos
)
pos_temp
=
temp
.
ref
(
node
.
pos
)
pos_temp_addr
=
ExprNodes
.
AmpersandNode
(
node
.
pos
,
operand
=
pos_temp
,
type
=
PyrexTypes
.
c_ptr_type
(
PyrexTypes
.
c_py_ssize_t_type
))
...
...
@@ -142,8 +142,8 @@ class DictIterTransform(Visitor.VisitorTransform):
stats
=
[
node
.
body
])
if
tuple_target
:
temp
=
UtilNodes
.
TempHandle
(
PyrexTypes
.
py_object
_type
)
temp
s
.
append
(
temp
)
temp
=
UtilNodes
.
TempHandle
(
Builtin
.
tuple
_type
)
temp
.
needs_cleanup
=
False
# assignment steals the reference
temp_tuple
=
temp
.
ref
(
tuple_target
.
pos
)
class
TempTupleNode
(
ExprNodes
.
TupleNode
):
# FIXME: remove this after result-code refactoring
...
...
@@ -156,10 +156,13 @@ class DictIterTransform(Visitor.VisitorTransform):
is_temp
=
1
,
type
=
Builtin
.
tuple_type
,
)
body
.
stats
.
insert
(
0
,
Nodes
.
SingleAssignmentNode
(
pos
=
tuple_target
.
pos
,
lhs
=
tuple_target
,
rhs
=
tuple_result
))
body
.
stats
.
insert
(
0
,
UtilNodes
.
TempsBlockNode
(
tuple_target
.
pos
,
temps
=
[
temp
],
body
=
Nodes
.
SingleAssignmentNode
(
pos
=
tuple_target
.
pos
,
lhs
=
tuple_target
,
rhs
=
tuple_result
)))
else
:
# execute all coercions before the assignments
coercion_stats
=
[]
...
...
@@ -216,7 +219,7 @@ class DictIterTransform(Visitor.VisitorTransform):
return
UtilNodes
.
TempsBlockNode
(
node
.
pos
,
temps
=
temps
,
body
=
Nodes
.
StatListNode
(
pos
=
node
.
pos
,
node
.
pos
,
stats
=
result_code
))
...
...
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