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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
29c7169e
Commit
29c7169e
authored
Jul 25, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up overloaded C++ assignment analysis code
parent
7c3ca028
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
20 deletions
+7
-20
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-20
No files found.
Cython/Compiler/Nodes.py
View file @
29c7169e
...
...
@@ -4912,7 +4912,7 @@ class SingleAssignmentNode(AssignmentNode):
op
=
env
.
lookup_operator_for_types
(
self
.
pos
,
'='
,
[
self
.
lhs
.
type
,
self
.
rhs
.
type
])
if
op
:
rhs
=
self
.
rhs
self
.
is_overloaded_assignment
=
1
self
.
is_overloaded_assignment
=
True
else
:
rhs
=
self
.
rhs
.
coerce_to
(
dtype
,
env
)
else
:
...
...
@@ -5064,11 +5064,8 @@ class SingleAssignmentNode(AssignmentNode):
self
.
rhs
.
generate_evaluation_code
(
code
)
def
generate_assignment_code
(
self
,
code
):
if
self
.
is_overloaded_assignment
:
self
.
lhs
.
generate_assignment_code
(
self
.
rhs
,
code
,
overloaded_assignment
=
True
)
else
:
self
.
lhs
.
generate_assignment_code
(
self
.
rhs
,
code
)
self
.
lhs
.
generate_assignment_code
(
self
.
rhs
,
code
,
overloaded_assignment
=
self
.
is_overloaded_assignment
)
def
generate_function_definitions
(
self
,
env
,
code
):
self
.
rhs
.
generate_function_definitions
(
env
,
code
)
...
...
@@ -5134,24 +5131,14 @@ class CascadedAssignmentNode(AssignmentNode):
coerced_values
=
{}
self
.
assignment_overloads
=
[]
for
lhs
in
self
.
lhs_list
:
overloaded
=
False
if
lhs
.
type
.
is_cpp_class
:
op
=
env
.
lookup_operator
(
'='
,
[
lhs
,
self
.
rhs
])
if
op
:
rhs
=
self
.
rhs
self
.
assignment_overloads
.
append
(
True
)
overloaded
=
True
else
:
self
.
assignment_overloads
.
append
(
False
)
else
:
self
.
assignment_overloads
.
append
(
False
)
overloaded
=
lhs
.
type
.
is_cpp_class
and
env
.
lookup_operator
(
'='
,
[
lhs
,
self
.
rhs
])
self
.
assignment_overloads
.
append
(
overloaded
)
if
lhs
.
type
not
in
coerced_values
and
lhs
.
type
!=
rhs
.
type
:
rhs
=
CloneNode
(
self
.
rhs
)
if
not
overloaded
:
rhs
=
CloneNode
(
self
.
rhs
)
.
coerce_to
(
lhs
.
type
,
env
)
rhs
=
rhs
.
coerce_to
(
lhs
.
type
,
env
)
self
.
coerced_values
.
append
(
rhs
)
coerced_values
[
lhs
.
type
]
=
rhs
else
:
self
.
assignment_overloads
.
append
(
False
)
# clone coerced values for all LHS assignments
self
.
cloned_values
=
[]
...
...
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