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
09a9be1d
Commit
09a9be1d
authored
Jul 27, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
a08d2d04
5c16873c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-0
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+3
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
09a9be1d
...
...
@@ -9701,6 +9701,14 @@ class BoolBinopNode(ExprNode):
operand
=
BoolBinopResultNode
(
operand
,
self
.
type
,
env
)
return
operand
def
wrap_operands
(
self
,
env
):
"""
Must get called by transforms that want to create a correct BoolBinopNode
after the type analysis phase.
"""
self
.
operand1
=
self
.
_wrap_operand
(
self
.
operand1
,
env
)
self
.
operand2
=
self
.
_wrap_operand
(
self
.
operand2
,
env
)
def
coerce_to_boolean
(
self
,
env
):
return
self
.
coerce_to
(
PyrexTypes
.
c_bint_type
,
env
)
...
...
Cython/Compiler/Optimize.py
View file @
09a9be1d
...
...
@@ -2138,7 +2138,7 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
"""Transform int() into a faster C function call.
"""
if
len
(
pos_args
)
==
0
:
return
ExprNodes
.
IntNode
(
node
,
value
=
"0"
,
constant_result
=
0
,
return
ExprNodes
.
IntNode
(
node
.
pos
,
value
=
"0"
,
constant_result
=
0
,
type
=
PyrexTypes
.
py_object_type
)
elif
len
(
pos_args
)
!=
1
:
return
node
# int(x, base)
...
...
@@ -2316,10 +2316,10 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
is_temp
=
True
,
))
def
join_with_or
(
a
,
b
,
make_binop_node
=
ExprNodes
.
binop_node
):
def
join_with_or
(
a
,
b
,
make_binop_node
=
ExprNodes
.
binop_node
):
or_node
=
make_binop_node
(
node
.
pos
,
'or'
,
a
,
b
)
or_node
.
type
=
PyrexTypes
.
c_bint_type
or_node
.
is_temp
=
True
or_node
.
wrap_operands
(
env
)
return
or_node
test_node
=
reduce
(
join_with_or
,
test_nodes
).
coerce_to
(
node
.
type
,
env
)
...
...
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