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
8fd5165e
Commit
8fd5165e
authored
Jul 22, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support retrieving "delayed" temps before or after allocate_temps phase (dead code for now)
parent
0defd1cf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
7 deletions
+24
-7
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+12
-7
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+9
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
8fd5165e
...
@@ -810,6 +810,7 @@ class NameNode(AtomicExprNode):
...
@@ -810,6 +810,7 @@ class NameNode(AtomicExprNode):
is_name
=
1
is_name
=
1
skip_assignment_decref
=
False
skip_assignment_decref
=
False
entry
=
None
def
create_analysed_rvalue
(
pos
,
env
,
entry
):
def
create_analysed_rvalue
(
pos
,
env
,
entry
):
node
=
NameNode
(
pos
)
node
=
NameNode
(
pos
)
...
@@ -845,7 +846,9 @@ class NameNode(AtomicExprNode):
...
@@ -845,7 +846,9 @@ class NameNode(AtomicExprNode):
def
analyse_as_module
(
self
,
env
):
def
analyse_as_module
(
self
,
env
):
# Try to interpret this as a reference to a cimported module.
# Try to interpret this as a reference to a cimported module.
# Returns the module scope, or None.
# Returns the module scope, or None.
entry
=
env
.
lookup
(
self
.
name
)
entry
=
self
.
entry
if
not
entry
:
entry
=
env
.
lookup
(
self
.
name
)
if
entry
and
entry
.
as_module
:
if
entry
and
entry
.
as_module
:
return
entry
.
as_module
return
entry
.
as_module
return
None
return
None
...
@@ -853,14 +856,17 @@ class NameNode(AtomicExprNode):
...
@@ -853,14 +856,17 @@ class NameNode(AtomicExprNode):
def
analyse_as_extension_type
(
self
,
env
):
def
analyse_as_extension_type
(
self
,
env
):
# Try to interpret this as a reference to an extension type.
# Try to interpret this as a reference to an extension type.
# Returns the extension type, or None.
# Returns the extension type, or None.
entry
=
env
.
lookup
(
self
.
name
)
entry
=
self
.
entry
if
not
entry
:
entry
=
env
.
lookup
(
self
.
name
)
if
entry
and
entry
.
is_type
and
entry
.
type
.
is_extension_type
:
if
entry
and
entry
.
is_type
and
entry
.
type
.
is_extension_type
:
return
entry
.
type
return
entry
.
type
else
:
else
:
return
None
return
None
def
analyse_target_declaration
(
self
,
env
):
def
analyse_target_declaration
(
self
,
env
):
self
.
entry
=
env
.
lookup_here
(
self
.
name
)
if
not
self
.
entry
:
self
.
entry
=
env
.
lookup_here
(
self
.
name
)
if
not
self
.
entry
:
if
not
self
.
entry
:
self
.
entry
=
env
.
declare_var
(
self
.
name
,
py_object_type
,
self
.
pos
)
self
.
entry
=
env
.
declare_var
(
self
.
name
,
py_object_type
,
self
.
pos
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'initalized'
),
True
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'initalized'
),
True
)
...
@@ -870,10 +876,9 @@ class NameNode(AtomicExprNode):
...
@@ -870,10 +876,9 @@ class NameNode(AtomicExprNode):
if
self
.
entry
.
is_pyglobal
and
self
.
entry
.
is_member
:
if
self
.
entry
.
is_pyglobal
and
self
.
entry
.
is_member
:
env
.
use_utility_code
(
type_cache_invalidation_code
)
env
.
use_utility_code
(
type_cache_invalidation_code
)
def
analyse_types
(
self
,
env
,
entry
=
None
):
def
analyse_types
(
self
,
env
):
if
entry
is
None
:
if
self
.
entry
is
None
:
entry
=
env
.
lookup
(
self
.
name
)
self
.
entry
=
env
.
lookup
(
self
.
name
)
self
.
entry
=
entry
if
not
self
.
entry
:
if
not
self
.
entry
:
self
.
entry
=
env
.
declare_builtin
(
self
.
name
,
self
.
pos
)
self
.
entry
=
env
.
declare_builtin
(
self
.
name
,
self
.
pos
)
if
not
self
.
entry
:
if
not
self
.
entry
:
...
...
Cython/Compiler/Main.py
View file @
8fd5165e
...
@@ -360,6 +360,7 @@ def create_default_pipeline(context, options, result):
...
@@ -360,6 +360,7 @@ def create_default_pipeline(context, options, result):
from
ParseTreeTransforms
import
AnalyseDeclarationsTransform
,
AnalyseExpressionsTransform
from
ParseTreeTransforms
import
AnalyseDeclarationsTransform
,
AnalyseExpressionsTransform
from
ParseTreeTransforms
import
CreateClosureClasses
,
MarkClosureVisitor
,
DecoratorTransform
from
ParseTreeTransforms
import
CreateClosureClasses
,
MarkClosureVisitor
,
DecoratorTransform
from
Optimize
import
FlattenInListTransform
,
SwitchTransform
,
OptimizeRefcounting
from
Optimize
import
FlattenInListTransform
,
SwitchTransform
,
OptimizeRefcounting
from
CodeGeneration
import
AnchorTemps
from
Buffer
import
BufferTransform
from
Buffer
import
BufferTransform
from
ModuleNode
import
check_c_classes
from
ModuleNode
import
check_c_classes
...
@@ -376,6 +377,7 @@ def create_default_pipeline(context, options, result):
...
@@ -376,6 +377,7 @@ def create_default_pipeline(context, options, result):
BufferTransform
(
context
),
BufferTransform
(
context
),
SwitchTransform
(),
SwitchTransform
(),
OptimizeRefcounting
(
context
),
OptimizeRefcounting
(
context
),
# AnchorTemps(context),
# CreateClosureClasses(context),
# CreateClosureClasses(context),
create_generate_code
(
context
,
options
,
result
)
create_generate_code
(
context
,
options
,
result
)
]
]
...
...
Cython/Compiler/Nodes.py
View file @
8fd5165e
...
@@ -73,6 +73,7 @@ class Node(object):
...
@@ -73,6 +73,7 @@ class Node(object):
is_name
=
0
is_name
=
0
is_literal
=
0
is_literal
=
0
temps
=
None
# All descandants should set child_attrs to a list of the attributes
# All descandants should set child_attrs to a list of the attributes
# containing nodes considered "children" in the tree. Each such attribute
# containing nodes considered "children" in the tree. Each such attribute
...
...
Cython/Compiler/Symtab.py
View file @
8fd5165e
...
@@ -141,6 +141,15 @@ class Entry:
...
@@ -141,6 +141,15 @@ class Entry:
def redeclared(self, pos):
def redeclared(self, pos):
error(pos, "'%s'
does
not
match
previous
declaration
" % self.name)
error(pos, "'%s'
does
not
match
previous
declaration
" % self.name)
error(self.pos, "
Previous
declaration
is
here
")
error(self.pos, "
Previous
declaration
is
here
")
def new_temp(type, description=""):
# Returns a temporary entry which is "
floating
" and not finally resolved
# before the AnchorTemps transform is run. cname will not be available on
# the temp before this transform is run. See the mentioned transform for
# more docs.
e = Entry(name="
$
" + description, type=type, cname="
<
temperror
>
")
e.is_variable = True
return e
class Scope:
class Scope:
# name string Unqualified name
# name string Unqualified 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