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
Kirill Smelkov
cython
Commits
cf796103
Commit
cf796103
authored
Dec 14, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set constant_result of empty containers created in ConstantFolding transform
parent
83d7bd2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+6
-3
No files found.
Cython/Compiler/Optimize.py
View file @
cf796103
...
@@ -3471,11 +3471,14 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
...
@@ -3471,11 +3471,14 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
if
isinstance
(
node
.
loop
,
Nodes
.
StatListNode
)
and
not
node
.
loop
.
stats
:
if
isinstance
(
node
.
loop
,
Nodes
.
StatListNode
)
and
not
node
.
loop
.
stats
:
# loop was pruned already => transform into literal
# loop was pruned already => transform into literal
if
node
.
type
is
Builtin
.
list_type
:
if
node
.
type
is
Builtin
.
list_type
:
return
ExprNodes
.
ListNode
(
node
.
pos
,
args
=
[])
return
ExprNodes
.
ListNode
(
node
.
pos
,
args
=
[],
constant_result
=
[])
elif
node
.
type
is
Builtin
.
set_type
:
elif
node
.
type
is
Builtin
.
set_type
:
return
ExprNodes
.
SetNode
(
node
.
pos
,
args
=
[])
return
ExprNodes
.
SetNode
(
node
.
pos
,
args
=
[],
constant_result
=
set
())
elif
node
.
type
is
Builtin
.
dict_type
:
elif
node
.
type
is
Builtin
.
dict_type
:
return
ExprNodes
.
DictNode
(
node
.
pos
,
key_value_pairs
=
[])
return
ExprNodes
.
DictNode
(
node
.
pos
,
key_value_pairs
=
[],
constant_result
=
{})
return
node
return
node
def
visit_ForInStatNode
(
self
,
node
):
def
visit_ForInStatNode
(
self
,
node
):
...
...
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