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
f3a3bbcf
Commit
f3a3bbcf
authored
Jan 16, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
fix temp allocation order, remove straggling comment output
parents
363eb37c
a48ee512
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
f3a3bbcf
...
@@ -467,7 +467,10 @@ class ExprNode(Node):
...
@@ -467,7 +467,10 @@ class ExprNode(Node):
elif
src
.
type
.
is_pyobject
:
elif
src
.
type
.
is_pyobject
:
src
=
CoerceFromPyTypeNode
(
dst_type
,
src
,
env
)
src
=
CoerceFromPyTypeNode
(
dst_type
,
src
,
env
)
else
:
# neither src nor dst are py types
else
:
# neither src nor dst are py types
if
not
dst_type
.
assignable_from
(
src_type
):
# Added the string comparison, since for c types that
# is enough, but SageX gets confused when the types are
# in different files.
if
not
(
str
(
src
.
type
)
==
str
(
dst_type
)
or
dst_type
.
assignable_from
(
src_type
)):
error
(
self
.
pos
,
"Cannot assign type '%s' to '%s'"
%
error
(
self
.
pos
,
"Cannot assign type '%s' to '%s'"
%
(
src
.
type
,
dst_type
))
(
src
.
type
,
dst_type
))
return
src
return
src
...
@@ -3079,8 +3082,8 @@ class CloneNode(CoercionNode):
...
@@ -3079,8 +3082,8 @@ class CloneNode(CoercionNode):
pass
pass
def
generate_disposal_code
(
self
,
code
):
def
generate_disposal_code
(
self
,
code
):
code
.
putln
(
"// ---- CloneNode.generate_disposal_code() for %s"
%
self
.
arg
.
result_code
)
pass
def
allocate_temps
(
self
,
env
):
def
allocate_temps
(
self
,
env
):
self
.
result_code
=
self
.
calculate_result_code
()
self
.
result_code
=
self
.
calculate_result_code
()
...
...
Cython/Compiler/Nodes.py
View file @
f3a3bbcf
...
@@ -2742,9 +2742,9 @@ class InPlaceAssignmentNode(AssignmentNode):
...
@@ -2742,9 +2742,9 @@ class InPlaceAssignmentNode(AssignmentNode):
self
.
result
.
allocate_temps
(
env
)
self
.
result
.
allocate_temps
(
env
)
if
use_temp
:
if
use_temp
:
self
.
rhs
=
self
.
rhs
.
coerce_to_temp
(
env
)
self
.
rhs
=
self
.
rhs
.
coerce_to_temp
(
env
)
self
.
rhs
.
allocate_temps
(
env
)
self
.
dup
.
allocate_subexpr_temps
(
env
)
self
.
dup
.
allocate_subexpr_temps
(
env
)
self
.
dup
.
allocate_temp
(
env
)
self
.
dup
.
allocate_temp
(
env
)
self
.
rhs
.
allocate_temps
(
env
)
def
analyse_expressions_2
(
self
,
env
):
def
analyse_expressions_2
(
self
,
env
):
self
.
lhs
.
allocate_target_temps
(
env
)
self
.
lhs
.
allocate_target_temps
(
env
)
...
@@ -2761,7 +2761,6 @@ class InPlaceAssignmentNode(AssignmentNode):
...
@@ -2761,7 +2761,6 @@ class InPlaceAssignmentNode(AssignmentNode):
self
.
dup
.
generate_subexpr_evaluation_code
(
code
)
self
.
dup
.
generate_subexpr_evaluation_code
(
code
)
self
.
dup
.
generate_result_code
(
code
)
self
.
dup
.
generate_result_code
(
code
)
if
self
.
lhs
.
type
.
is_pyobject
:
if
self
.
lhs
.
type
.
is_pyobject
:
code
.
putln
(
"//---- iadd code"
);
code
.
putln
(
code
.
putln
(
"%s = %s(%s, %s); if (!%s) %s"
%
(
"%s = %s(%s, %s); if (!%s) %s"
%
(
self
.
result
.
result_code
,
self
.
result
.
result_code
,
...
...
Cython/Compiler/PyrexTypes.py
View file @
f3a3bbcf
...
@@ -90,7 +90,7 @@ class PyrexType:
...
@@ -90,7 +90,7 @@ class PyrexType:
return
self
.
same_as_resolved_type
(
other_type
.
resolve
(),
**
kwds
)
return
self
.
same_as_resolved_type
(
other_type
.
resolve
(),
**
kwds
)
def
same_as_resolved_type
(
self
,
other_type
):
def
same_as_resolved_type
(
self
,
other_type
):
return
self
is
other_type
or
other_type
is
error_type
return
self
==
other_type
or
other_type
is
error_type
def
subtype_of
(
self
,
other_type
):
def
subtype_of
(
self
,
other_type
):
return
self
.
subtype_of_resolved_type
(
other_type
.
resolve
())
return
self
.
subtype_of_resolved_type
(
other_type
.
resolve
())
...
...
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