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
6f01e977
Commit
6f01e977
authored
Sep 18, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache const or volatile scopes to avoid duplicated entries
parent
a192940f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+10
-2
No files found.
Cython/Compiler/PyrexTypes.py
View file @
6f01e977
...
@@ -1837,14 +1837,22 @@ class CConstOrVolatileType(BaseType):
...
@@ -1837,14 +1837,22 @@ class CConstOrVolatileType(BaseType):
subtypes
=
[
'cv_base_type'
]
subtypes
=
[
'cv_base_type'
]
is_cv_qualified
=
1
is_cv_qualified
=
1
cached_scopes
=
{}
def
__init__
(
self
,
base_type
,
is_const
=
0
,
is_volatile
=
0
):
def
__init__
(
self
,
base_type
,
is_const
=
0
,
is_volatile
=
0
):
self
.
cv_base_type
=
base_type
self
.
cv_base_type
=
base_type
self
.
is_const
=
is_const
self
.
is_const
=
is_const
self
.
is_volatile
=
is_volatile
self
.
is_volatile
=
is_volatile
if
base_type
.
has_attributes
and
base_type
.
scope
is
not
None
:
if
base_type
.
has_attributes
and
base_type
.
scope
is
not
None
:
key
=
base_type
.
resolve
()
try
:
self
.
scope
=
self
.
cached_scopes
[
key
]
except
KeyError
:
# caching the scopes avoids duplicating entries for each scope
# which can lead to duplicate entries being considered for overlad resolution
# resulting in bogus ambiguous calls even when there is a single definition
from
.Symtab
import
CConstOrVolatileScope
from
.Symtab
import
CConstOrVolatileScope
self
.
scope
=
CConstOrVolatileScope
(
base_type
.
scope
,
is_const
,
is_volatile
)
self
.
scope
=
self
.
cached_scopes
[
key
]
=
CConstOrVolatileScope
(
base_type
.
scope
,
is_const
,
is_volatile
)
def
cv_string
(
self
):
def
cv_string
(
self
):
cvstring
=
""
cvstring
=
""
...
...
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