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
Gwenaël Samain
cython
Commits
6ff9d8a5
Commit
6ff9d8a5
authored
Nov 29, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NewTempsExprNode cleanup -- easier to override temp handling
parent
0556c173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+14
-6
No files found.
Cython/Compiler/ExprNodes.py
View file @
6ff9d8a5
...
...
@@ -436,14 +436,10 @@ class ExprNode(Node):
# its sub-expressions, and dispose of any
# temporary results of its sub-expressions.
self
.
generate_subexpr_evaluation_code
(
code
)
self
.
pre_generate_result_code
(
code
)
self
.
generate_result_code
(
code
)
if
self
.
is_temp
:
self
.
generate_subexpr_disposal_code
(
code
)
def
pre_generate_result_code
(
self
,
code
):
pass
def
generate_subexpr_evaluation_code
(
self
,
code
):
for
node
in
self
.
subexpr_nodes
():
node
.
generate_evaluation_code
(
code
)
...
...
@@ -602,7 +598,14 @@ class NewTempExprNode(ExprNode):
else
:
self
.
release_subexpr_temps
(
env
)
def
pre_generate_result_code
(
self
,
code
):
def
generate_evaluation_code
(
self
,
code
):
code
.
mark_pos
(
self
.
pos
)
# Generate code to evaluate this node and
# its sub-expressions, and dispose of any
# temporary results of its sub-expressions.
self
.
generate_subexpr_evaluation_code
(
code
)
if
self
.
is_temp
:
type
=
self
.
type
if
not
type
.
is_void
:
...
...
@@ -611,10 +614,15 @@ class NewTempExprNode(ExprNode):
if
self
.
backwards_compatible_result
:
self
.
temp_code
=
self
.
backwards_compatible_result
else
:
self
.
temp_code
=
code
.
funcstate
.
allocate_temp
(
type
,
manage_ref
=
True
)
self
.
temp_code
=
code
.
funcstate
.
allocate_temp
(
type
,
manage_ref
=
True
)
else
:
self
.
temp_code
=
None
self
.
generate_result_code
(
code
)
if
self
.
is_temp
:
self
.
generate_subexpr_disposal_code
(
code
)
def
generate_disposal_code
(
self
,
code
):
if
self
.
is_temp
:
if
self
.
type
.
is_pyobject
:
...
...
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