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
d08ae559
Commit
d08ae559
authored
5 years ago
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make cypclass use temporaries
parent
6f6e64f5
snippets_article
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
d08ae559
...
...
@@ -5761,6 +5761,10 @@ class SimpleCallNode(CallNode):
if
i
>
0
:
# first argument doesn't matter
some_args_in_temps
=
True
arg
=
arg
.
coerce_to_temp
(
env
)
elif
arg
.
type
.
is_cyp_class
:
if
i
>
0
:
some_args_in_temps
=
True
arg
=
arg
.
coerce_to_temp
(
env
)
args
[
i
]
=
arg
# handle additional varargs parameters
...
...
@@ -5828,6 +5832,8 @@ class SimpleCallNode(CallNode):
elif
self
.
type
.
is_memoryviewslice
:
self
.
is_temp
=
1
# func_type.exception_check = True
elif
self
.
type
.
is_cyp_class
:
self
.
is_temp
=
1
if
self
.
is_temp
and
self
.
type
.
is_reference
:
self
.
type
=
PyrexTypes
.
CFakeReferenceType
(
self
.
type
.
ref_base_type
)
...
...
@@ -6278,6 +6284,10 @@ class InlinedDefNodeCallNode(CallNode):
if
i
>
0
:
# first argument doesn't matter
some_args_in_temps
=
True
arg
=
arg
.
coerce_to_temp
(
env
)
elif
arg
.
type
.
is_cyp_class
:
if
i
>
0
:
# first argument doesn't matter
some_args_in_temps
=
True
arg
=
arg
.
coerce_to_temp
(
env
)
self
.
args
[
i
]
=
arg
if
some_args_in_temps
:
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/Nodes.py
View file @
d08ae559
...
...
@@ -5432,7 +5432,7 @@ class SingleAssignmentNode(AssignmentNode):
if
use_temp
or
rhs
.
is_attribute
or
(
not
rhs
.
is_name
and
not
rhs
.
is_literal
and
rhs
.
type
.
is_pyobject
):
(
rhs
.
type
.
is_pyobject
or
rhs
.
type
.
is_cyp_class
)
):
# things like (cdef) attribute access are not safe (traverses pointers)
rhs
=
rhs
.
coerce_to_temp
(
env
)
elif
rhs
.
type
.
is_pyobject
:
...
...
@@ -5640,7 +5640,7 @@ class CascadedAssignmentNode(AssignmentNode):
rhs
=
rhs
.
coerce_to
(
lhs_types
.
pop
(),
env
)
if
not
rhs
.
is_name
and
not
rhs
.
is_literal
and
(
use_temp
or
rhs
.
is_attribute
or
rhs
.
type
.
is_pyobject
):
use_temp
or
rhs
.
is_attribute
or
rhs
.
type
.
is_pyobject
or
rhs
.
type
.
is_cyp_class
):
rhs
=
rhs
.
coerce_to_temp
(
env
)
else
:
rhs
=
rhs
.
coerce_to_simple
(
env
)
...
...
This diff is collapsed.
Click to expand it.
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