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
Xavier Thompson
cython
Commits
2c104e67
Commit
2c104e67
authored
Oct 29, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only define used ctuples.
parent
39cae5e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+4
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+6
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
2c104e67
...
...
@@ -6595,6 +6595,7 @@ class TupleNode(SequenceNode):
self
.
generate_sequence_packing_code
(
code
)
code
.
put_giveref
(
self
.
py_result
())
else
:
self
.
type
.
entry
.
used
=
True
self
.
generate_sequence_packing_code
(
code
)
...
...
Cython/Compiler/ModuleNode.py
View file @
2c104e67
...
...
@@ -721,6 +721,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
pass
elif
type
.
is_struct_or_union
or
type
.
is_cpp_class
:
self
.
generate_struct_union_predeclaration
(
entry
,
code
)
elif
type
.
is_ctuple
and
entry
.
used
:
self
.
generate_struct_union_predeclaration
(
entry
.
type
.
struct_entry
,
code
)
elif
type
.
is_extension_type
:
self
.
generate_objstruct_predeclaration
(
type
,
code
)
# Actual declarations
...
...
@@ -734,6 +736,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_enum_definition
(
entry
,
code
)
elif
type
.
is_struct_or_union
:
self
.
generate_struct_union_definition
(
entry
,
code
)
elif
type
.
is_ctuple
and
entry
.
used
:
self
.
generate_struct_union_definition
(
entry
.
type
.
struct_entry
,
code
)
elif
type
.
is_cpp_class
:
self
.
generate_cpp_class_definition
(
entry
,
code
)
elif
type
.
is_extension_type
:
...
...
Cython/Compiler/Nodes.py
View file @
2c104e67
...
...
@@ -1172,7 +1172,8 @@ class CTupleBaseTypeNode(CBaseTypeNode):
return
PyrexType
.
error_type
component_types
.
append
(
type
)
type
=
PyrexTypes
.
c_tuple_type
(
component_types
)
env
.
declare_tuple_type
(
self
.
pos
,
type
)
entry
=
env
.
declare_tuple_type
(
self
.
pos
,
type
)
entry
.
used
=
True
return
type
...
...
Cython/Compiler/Symtab.py
View file @
2c104e67
...
...
@@ -607,7 +607,7 @@ class Scope(object):
return
entry
def
declare_tuple_type
(
self
,
pos
,
type
):
self
.
outer_scope
.
declare_tuple_type
(
pos
,
type
)
return
self
.
outer_scope
.
declare_tuple_type
(
pos
,
type
)
def
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'private'
,
...
...
@@ -1070,9 +1070,11 @@ class ModuleScope(Scope):
scope
=
StructOrUnionScope
(
cname
)
for
ix
,
component
in
enumerate
(
type
.
components
):
scope
.
declare_var
(
name
=
"f%s"
%
ix
,
type
=
component
,
pos
=
pos
)
entry
=
self
.
declare_struct_or_union
(
cname
,
'struct'
,
scope
,
typedef_flag
=
True
,
pos
=
pos
,
cname
=
cname
)
entry
.
used
=
True
type
.
struct
=
entry
struct_entry
=
self
.
declare_struct_or_union
(
cname
+
'_struct'
,
'struct'
,
scope
,
typedef_flag
=
True
,
pos
=
pos
,
cname
=
cname
)
self
.
type_entries
.
remove
(
struct_entry
)
type
.
struct_entry
=
struct_entry
type
.
entry
=
self
.
declare_type
(
cname
,
type
,
pos
,
cname
)
return
type
.
entry
def
declare_builtin
(
self
,
name
,
pos
):
if
not
hasattr
(
builtins
,
name
)
\
...
...
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