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
364dfc77
Commit
364dfc77
authored
Sep 28, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defer call of calculate_result_code also for target nodes.
parent
a6695f2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
364dfc77
...
@@ -168,6 +168,7 @@ class ExprNode(Node):
...
@@ -168,6 +168,7 @@ class ExprNode(Node):
saved_subexpr_nodes
=
None
saved_subexpr_nodes
=
None
is_temp
=
0
is_temp
=
0
is_target
=
0
def
get_child_attrs
(
self
):
def
get_child_attrs
(
self
):
return
self
.
subexprs
return
self
.
subexprs
...
@@ -206,10 +207,10 @@ class ExprNode(Node):
...
@@ -206,10 +207,10 @@ class ExprNode(Node):
return
self
.
saved_subexpr_nodes
return
self
.
saved_subexpr_nodes
def
result
(
self
):
def
result
(
self
):
if
self
.
is_temp
:
if
not
self
.
is_temp
or
self
.
is_target
:
return
self
.
result_code
else
:
return
self
.
calculate_result_code
()
return
self
.
calculate_result_code
()
else
:
# i.e. self.is_temp:
return
self
.
result_code
def
result_as
(
self
,
type
=
None
):
def
result_as
(
self
,
type
=
None
):
# Return the result code cast to the specified C type.
# Return the result code cast to the specified C type.
...
@@ -335,7 +336,7 @@ class ExprNode(Node):
...
@@ -335,7 +336,7 @@ class ExprNode(Node):
if
debug_temp_alloc
:
if
debug_temp_alloc
:
print
(
"%s Allocating target temps"
%
self
)
print
(
"%s Allocating target temps"
%
self
)
self
.
allocate_subexpr_temps
(
env
)
self
.
allocate_subexpr_temps
(
env
)
self
.
result_code
=
self
.
target_code
()
self
.
is_target
=
True
if
rhs
:
if
rhs
:
rhs
.
release_temp
(
env
)
rhs
.
release_temp
(
env
)
self
.
release_subexpr_temps
(
env
)
self
.
release_subexpr_temps
(
env
)
...
...
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