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
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
Show 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):
...
@@ -4912,7 +4912,7 @@ class SingleAssignmentNode(AssignmentNode):
op
=
env
.
lookup_operator_for_types
(
self
.
pos
,
'='
,
[
self
.
lhs
.
type
,
self
.
rhs
.
type
])
op
=
env
.
lookup_operator_for_types
(
self
.
pos
,
'='
,
[
self
.
lhs
.
type
,
self
.
rhs
.
type
])
if
op
:
if
op
:
rhs
=
self
.
rhs
rhs
=
self
.
rhs
self
.
is_overloaded_assignment
=
1
self
.
is_overloaded_assignment
=
True
else
:
else
:
rhs
=
self
.
rhs
.
coerce_to
(
dtype
,
env
)
rhs
=
self
.
rhs
.
coerce_to
(
dtype
,
env
)
else
:
else
:
...
@@ -5064,11 +5064,8 @@ class SingleAssignmentNode(AssignmentNode):
...
@@ -5064,11 +5064,8 @@ class SingleAssignmentNode(AssignmentNode):
self
.
rhs
.
generate_evaluation_code
(
code
)
self
.
rhs
.
generate_evaluation_code
(
code
)
def
generate_assignment_code
(
self
,
code
):
def
generate_assignment_code
(
self
,
code
):
if
self
.
is_overloaded_assignment
:
self
.
lhs
.
generate_assignment_code
(
self
.
lhs
.
generate_assignment_code
(
self
.
rhs
,
code
,
overloaded_assignment
=
True
)
self
.
rhs
,
code
,
overloaded_assignment
=
self
.
is_overloaded_assignment
)
else
:
self
.
lhs
.
generate_assignment_code
(
self
.
rhs
,
code
)
def
generate_function_definitions
(
self
,
env
,
code
):
def
generate_function_definitions
(
self
,
env
,
code
):
self
.
rhs
.
generate_function_definitions
(
env
,
code
)
self
.
rhs
.
generate_function_definitions
(
env
,
code
)
...
@@ -5134,24 +5131,14 @@ class CascadedAssignmentNode(AssignmentNode):
...
@@ -5134,24 +5131,14 @@ class CascadedAssignmentNode(AssignmentNode):
coerced_values
=
{}
coerced_values
=
{}
self
.
assignment_overloads
=
[]
self
.
assignment_overloads
=
[]
for
lhs
in
self
.
lhs_list
:
for
lhs
in
self
.
lhs_list
:
overloaded
=
False
overloaded
=
lhs
.
type
.
is_cpp_class
and
env
.
lookup_operator
(
'='
,
[
lhs
,
self
.
rhs
])
if
lhs
.
type
.
is_cpp_class
:
self
.
assignment_overloads
.
append
(
overloaded
)
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
)
if
lhs
.
type
not
in
coerced_values
and
lhs
.
type
!=
rhs
.
type
:
if
lhs
.
type
not
in
coerced_values
and
lhs
.
type
!=
rhs
.
type
:
rhs
=
CloneNode
(
self
.
rhs
)
if
not
overloaded
:
if
not
overloaded
:
rhs
=
CloneNode
(
self
.
rhs
)
.
coerce_to
(
lhs
.
type
,
env
)
rhs
=
rhs
.
coerce_to
(
lhs
.
type
,
env
)
self
.
coerced_values
.
append
(
rhs
)
self
.
coerced_values
.
append
(
rhs
)
coerced_values
[
lhs
.
type
]
=
rhs
coerced_values
[
lhs
.
type
]
=
rhs
else
:
self
.
assignment_overloads
.
append
(
False
)
# clone coerced values for all LHS assignments
# clone coerced values for all LHS assignments
self
.
cloned_values
=
[]
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