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
be7f5fd9
Commit
be7f5fd9
authored
May 27, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completely remove init_to_none attribute
parent
931b8d94
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
19 deletions
+1
-19
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+1
-4
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+0
-6
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+0
-4
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+0
-2
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+0
-3
No files found.
Cython/Compiler/Code.py
View file @
be7f5fd9
...
...
@@ -1290,10 +1290,7 @@ class CCodeWriter(object):
def
put_var_decref
(
self
,
entry
):
if
entry
.
type
.
is_pyobject
:
if
entry
.
init_to_none
:
self
.
putln
(
"__Pyx_DECREF(%s);"
%
self
.
entry_as_pyobject
(
entry
))
else
:
self
.
putln
(
"__Pyx_XDECREF(%s);"
%
self
.
entry_as_pyobject
(
entry
))
self
.
putln
(
"__Pyx_XDECREF(%s);"
%
self
.
entry_as_pyobject
(
entry
))
def
put_var_decref_clear
(
self
,
entry
):
if
entry
.
type
.
is_pyobject
:
...
...
Cython/Compiler/Nodes.py
View file @
be7f5fd9
...
...
@@ -1416,10 +1416,6 @@ class FuncDefNode(StatNode, BlockNode):
if
entry
.
type
.
is_pyobject
:
if
(
acquire_gil
or
entry
.
assignments
)
and
not
entry
.
in_closure
:
code
.
put_var_incref
(
entry
)
# ----- Initialise local variables
for
entry
in
lenv
.
var_entries
:
if
entry
.
type
.
is_pyobject
and
entry
.
init_to_none
and
entry
.
used
:
code
.
put_init_var_to_py_none
(
entry
)
# ----- Initialise local buffer auxiliary variables
for
entry
in
lenv
.
var_entries
+
lenv
.
arg_entries
:
if
entry
.
type
.
is_buffer
and
entry
.
buffer_aux
.
buffer_info_var
.
used
:
...
...
@@ -2264,7 +2260,6 @@ class DefNode(FuncDefNode):
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
)
if
arg
.
type
.
is_pyobject
:
arg
.
entry
.
init
=
"0"
arg
.
entry
.
init_to_none
=
0
else
:
arg
.
entry
=
self
.
declare_argument
(
env
,
arg
)
arg
.
entry
.
used
=
1
...
...
@@ -2285,7 +2280,6 @@ class DefNode(FuncDefNode):
entry
=
env
.
declare_var
(
arg
.
name
,
type
,
arg
.
pos
)
entry
.
used
=
1
entry
.
init
=
"0"
entry
.
init_to_none
=
0
entry
.
xdecref_cleanup
=
1
arg
.
entry
=
entry
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'initialized'
),
True
)
...
...
Cython/Compiler/Optimize.py
View file @
be7f5fd9
...
...
@@ -3294,10 +3294,6 @@ class FinalOptimizePhase(Visitor.CythonTransform):
if
node
.
first
:
lhs
=
node
.
lhs
lhs
.
lhs_of_first_assignment
=
True
if
isinstance
(
lhs
,
ExprNodes
.
NameNode
)
and
lhs
.
entry
.
type
.
is_pyobject
:
# Have variable initialized to 0 rather than None
lhs
.
entry
.
init_to_none
=
False
lhs
.
entry
.
init
=
0
return
node
def
visit_SimpleCallNode
(
self
,
node
):
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
be7f5fd9
...
...
@@ -1540,8 +1540,6 @@ if VALUE is not None:
type_name
=
entry
.
type
.
module_name
+
'.'
+
type_name
if
entry
.
init
is
not
None
:
default_value
=
' = '
+
entry
.
init
elif
entry
.
init_to_none
:
default_value
=
' = '
+
repr
(
None
)
docstring
=
attr_name
+
': '
+
type_name
+
default_value
property
.
doc
=
EncodedString
(
docstring
)
# ---------------------------------------
...
...
Cython/Compiler/Symtab.py
View file @
be7f5fd9
...
...
@@ -96,7 +96,6 @@ class Entry(object):
# holding its home namespace
# pymethdef_cname string PyMethodDef structure
# signature Signature Arg & return types for Python func
# init_to_none boolean True if initial value should be None
# as_variable Entry Alternative interpretation of extension
# type name or builtin C function as a variable
# xdecref_cleanup boolean Use Py_XDECREF for error cleanup
...
...
@@ -157,7 +156,6 @@ class Entry(object):
func_cname = None
func_modifiers = []
doc = None
init_to_none = 0
as_variable = None
xdecref_cleanup = 0
in_cinclude = 0
...
...
@@ -1390,7 +1388,6 @@ class LocalScope(Scope):
api
=
api
,
in_pxd
=
in_pxd
,
is_cdef
=
is_cdef
)
if
type
.
is_pyobject
and
not
Options
.
init_local_none
:
entry
.
init
=
"0"
entry
.
init_to_none
=
False
entry
.
is_local
=
1
entry
.
in_with_gil_block
=
self
.
_in_with_gil_block
...
...
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