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
ce2617e2
Commit
ce2617e2
authored
Dec 07, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused (and broken) PersistantNode
parent
bcf510fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
59 deletions
+0
-59
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+0
-59
No files found.
Cython/Compiler/ExprNodes.py
View file @
ce2617e2
...
...
@@ -4849,67 +4849,8 @@ class CloneNode(CoercionNode):
def
free_temps
(
self
,
code
):
pass
class
DISABLED_PersistentNode
(
ExprNode
):
# A PersistentNode is like a CloneNode except it handles the temporary
# allocation itself by keeping track of the number of times it has been
# used.
subexprs
=
[
"arg"
]
temp_counter
=
0
generate_counter
=
0
analyse_counter
=
0
result_code
=
None
def
__init__
(
self
,
arg
,
uses
):
self
.
pos
=
arg
.
pos
self
.
arg
=
arg
self
.
uses
=
uses
def
analyse_types
(
self
,
env
):
if
self
.
analyse_counter
==
0
:
self
.
arg
.
analyse_types
(
env
)
self
.
type
=
self
.
arg
.
type
self
.
result_ctype
=
self
.
arg
.
result_ctype
self
.
is_temp
=
1
self
.
analyse_counter
+=
1
def
calculate_result_code
(
self
):
return
self
.
result
()
def
generate_evaluation_code
(
self
,
code
):
if
self
.
generate_counter
==
0
:
self
.
arg
.
generate_evaluation_code
(
code
)
code
.
putln
(
"%s = %s;"
%
(
self
.
result
(),
self
.
arg
.
result_as
(
self
.
ctype
())))
if
self
.
type
.
is_pyobject
:
code
.
put_incref
(
self
.
result
(),
self
.
ctype
())
self
.
arg
.
generate_disposal_code
(
code
)
self
.
generate_counter
+=
1
def
generate_disposal_code
(
self
,
code
):
if
self
.
generate_counter
==
self
.
uses
:
if
self
.
type
.
is_pyobject
:
code
.
put_decref_clear
(
self
.
result
(),
self
.
ctype
())
def
allocate_temps
(
self
,
env
,
result
=
None
):
if
self
.
temp_counter
==
0
:
self
.
arg
.
allocate_temps
(
env
)
self
.
allocate_temp
(
env
,
result
)
self
.
arg
.
release_temp
(
env
)
self
.
temp_counter
+=
1
def
allocate_temp
(
self
,
env
,
result
=
None
):
if
result
is
None
:
self
.
result_code
=
env
.
allocate_temp
(
self
.
type
)
else
:
self
.
result_code
=
result
def
release_temp
(
self
,
env
):
if
self
.
temp_counter
==
self
.
uses
:
env
.
release_temp
(
self
.
result
())
#------------------------------------------------------------------------------------
#
# Runtime support 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