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
968404a1
Commit
968404a1
authored
Apr 27, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Synthesize fused specializations only once
parent
50241a06
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
2 deletions
+9
-2
Cython/Compiler/FusedNode.pyx
Cython/Compiler/FusedNode.pyx
+1
-1
Cython/Compiler/Importer.py
Cython/Compiler/Importer.py
+3
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+3
-0
No files found.
Cython/Compiler/FusedNode.pyx
View file @
968404a1
...
...
@@ -748,7 +748,7 @@ class FusedCFuncDefNode(StatListNode):
code
.
mark_pos
(
stat
.
pos
)
if
isinstance
(
stat
,
ExprNodes
.
ExprNode
):
stat
.
generate_evaluation_code
(
code
)
elif
not
isinstance
(
stat
,
FuncDefNode
)
or
stat
.
entry
.
used
:
elif
not
isinstance
(
stat
,
FuncDefNode
)
:
#
or stat.entry.used:
stat
.
generate_execution_code
(
code
)
if
self
.
__signatures__
:
...
...
Cython/Compiler/Importer.py
View file @
968404a1
...
...
@@ -8,6 +8,7 @@ by Cython.
import
os
import
sys
import
imp
import
shutil
import
pyximport
...
...
@@ -33,3 +34,5 @@ def importer(modulename, version=None):
exec
open
(
filename
).
read
()
in
mod
.
__dict__
,
mod
.
__dict__
sys
.
modules
[
modulename
]
=
mod
return
mod
#shutil.copy(filename, os.path.splitext(filename)[0] + '.py')
#return __import__(modulename, None, None, [''])
Cython/Compiler/Nodes.py
View file @
968404a1
...
...
@@ -2630,7 +2630,7 @@ class DefNode(FuncDefNode):
decorator
.
decorator
.
analyse_expressions
(
env
)
def
needs_assignment_synthesis
(
self
,
env
,
code
=
None
):
if
self
.
is_wrapper
or
self
.
specialized_cpdefs
:
if
self
.
is_wrapper
or
self
.
specialized_cpdefs
or
self
.
entry
.
is_fused_specialized
:
return
False
if
self
.
is_staticmethod
:
return
True
...
...
Cython/Compiler/PyrexTypes.py
View file @
968404a1
...
...
@@ -2608,6 +2608,7 @@ def specialize_entry(entry, cname):
"""
Specialize an entry of a copied fused function or method
"""
entry
.
is_fused_specialized
=
True
entry
.
name
=
get_fused_cname
(
cname
,
entry
.
name
)
if
entry
.
is_cmethod
:
...
...
Cython/Compiler/Symtab.py
View file @
968404a1
...
...
@@ -121,6 +121,8 @@ class Entry(object):
# error_on_uninitialized Have Control Flow issue an error when this entry is
# used uninitialized
# cf_used boolean Entry is used
# is_fused_specialized boolean Whether this entry of a cdef or def function
# is a specialization
# TODO: utility_code and utility_code_definition serves the same purpose...
...
...
@@ -180,6 +182,7 @@ class Entry(object):
prev_entry = None
might_overflow = 0
fused_cfunction = None
is_fused_specialized = False
utility_code_definition = None
in_with_gil_block = 0
from_cython_utility_code = None
...
...
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