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
da34a287
Commit
da34a287
authored
Aug 09, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move method from Scope to CClassScope that only applies to extension types
parent
c75fc9f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+20
-20
No files found.
Cython/Compiler/Symtab.py
View file @
da34a287
...
...
@@ -832,25 +832,6 @@ class Scope(object):
def
add_include_file
(
self
,
filename
):
self
.
outer_scope
.
add_include_file
(
filename
)
def
get_refcounted_entries
(
self
,
include_weakref
=
False
,
include_gc_simple
=
True
):
py_attrs
=
[]
py_buffers
=
[]
memoryview_slices
=
[]
for
entry
in
self
.
var_entries
:
if
entry
.
type
.
is_pyobject
:
if
include_weakref
or
entry
.
name
!=
"__weakref__"
:
if
include_gc_simple
or
not
entry
.
type
.
is_gc_simple
:
py_attrs
.
append
(
entry
)
elif
entry
.
type
==
PyrexTypes
.
c_py_buffer_type
:
py_buffers
.
append
(
entry
)
elif
entry
.
type
.
is_memoryviewslice
:
memoryview_slices
.
append
(
entry
)
have_entries
=
py_attrs
or
py_buffers
or
memoryview_slices
return
have_entries
,
(
py_attrs
,
py_buffers
,
memoryview_slices
)
class
PreImportScope
(
Scope
):
...
...
@@ -1811,6 +1792,25 @@ class CClassScope(ClassScope):
"""
return
self
.
needs_gc
()
and
not
self
.
directives
.
get
(
'no_gc_clear'
,
False
)
def
get_refcounted_entries
(
self
,
include_weakref
=
False
,
include_gc_simple
=
True
):
py_attrs
=
[]
py_buffers
=
[]
memoryview_slices
=
[]
for
entry
in
self
.
var_entries
:
if
entry
.
type
.
is_pyobject
:
if
include_weakref
or
entry
.
name
!=
"__weakref__"
:
if
include_gc_simple
or
not
entry
.
type
.
is_gc_simple
:
py_attrs
.
append
(
entry
)
elif
entry
.
type
==
PyrexTypes
.
c_py_buffer_type
:
py_buffers
.
append
(
entry
)
elif
entry
.
type
.
is_memoryviewslice
:
memoryview_slices
.
append
(
entry
)
have_entries
=
py_attrs
or
py_buffers
or
memoryview_slices
return
have_entries
,
(
py_attrs
,
py_buffers
,
memoryview_slices
)
def
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'private'
,
api
=
0
,
in_pxd
=
0
,
is_cdef
=
0
):
...
...
@@ -1872,7 +1872,6 @@ class CClassScope(ClassScope):
self
.
namespace_cname
=
"(PyObject *)%s"
%
self
.
parent_type
.
typeptr_cname
return
entry
def
declare_pyfunction
(
self
,
name
,
pos
,
allow_redefine
=
False
):
# Add an entry for a method.
if
name
in
(
'__eq__'
,
'__ne__'
,
'__lt__'
,
'__gt__'
,
'__le__'
,
'__ge__'
):
...
...
@@ -2040,6 +2039,7 @@ class CClassScope(ClassScope):
if
base_entry
.
utility_code
:
entry
.
utility_code
=
base_entry
.
utility_code
class
CppClassScope
(
Scope
):
# Namespace of a C++ class.
...
...
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