Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
1a07ff88
Commit
1a07ff88
authored
Nov 17, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make isCompilerCreatedName() a method of InternedString
parent
b145b008
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
src/analysis/scoping_analysis.cpp
src/analysis/scoping_analysis.cpp
+3
-7
src/core/stringpool.cpp
src/core/stringpool.cpp
+6
-0
src/core/stringpool.h
src/core/stringpool.h
+2
-0
No files found.
src/analysis/scoping_analysis.cpp
View file @
1a07ff88
...
@@ -108,10 +108,6 @@ static InternedString mangleName(InternedString id, llvm::StringRef private_name
...
@@ -108,10 +108,6 @@ static InternedString mangleName(InternedString id, llvm::StringRef private_name
return
rtn
;
return
rtn
;
}
}
static
bool
isCompilerCreatedName
(
llvm
::
StringRef
name
)
{
return
name
[
0
]
==
'!'
||
name
[
0
]
==
'#'
;
}
class
ModuleScopeInfo
:
public
ScopeInfo
{
class
ModuleScopeInfo
:
public
ScopeInfo
{
public:
public:
ScopeInfo
*
getParent
()
override
{
return
NULL
;
}
ScopeInfo
*
getParent
()
override
{
return
NULL
;
}
...
@@ -121,7 +117,7 @@ public:
...
@@ -121,7 +117,7 @@ public:
bool
passesThroughClosure
()
override
{
return
false
;
}
bool
passesThroughClosure
()
override
{
return
false
;
}
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
if
(
isCompilerCreatedName
(
name
))
if
(
name
.
isCompilerCreatedName
(
))
return
VarScopeType
::
FAST
;
return
VarScopeType
::
FAST
;
else
else
return
VarScopeType
::
GLOBAL
;
return
VarScopeType
::
GLOBAL
;
...
@@ -185,7 +181,7 @@ public:
...
@@ -185,7 +181,7 @@ public:
bool
passesThroughClosure
()
override
{
return
false
;
}
bool
passesThroughClosure
()
override
{
return
false
;
}
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
if
(
isCompilerCreatedName
(
name
))
if
(
name
.
isCompilerCreatedName
(
))
return
VarScopeType
::
FAST
;
return
VarScopeType
::
FAST
;
else
if
(
forced_globals
.
find
(
name
)
!=
forced_globals
.
end
())
else
if
(
forced_globals
.
find
(
name
)
!=
forced_globals
.
end
())
return
VarScopeType
::
GLOBAL
;
return
VarScopeType
::
GLOBAL
;
...
@@ -341,7 +337,7 @@ public:
...
@@ -341,7 +337,7 @@ public:
bool
passesThroughClosure
()
override
{
return
usage
->
passthrough_accesses
.
size
()
>
0
&&
!
createsClosure
();
}
bool
passesThroughClosure
()
override
{
return
usage
->
passthrough_accesses
.
size
()
>
0
&&
!
createsClosure
();
}
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
VarScopeType
getScopeTypeOfName
(
InternedString
name
)
override
{
if
(
isCompilerCreatedName
(
name
))
if
(
name
.
isCompilerCreatedName
(
))
return
VarScopeType
::
FAST
;
return
VarScopeType
::
FAST
;
if
(
usage
->
forced_globals
.
count
(
name
)
>
0
)
if
(
usage
->
forced_globals
.
count
(
name
)
>
0
)
...
...
src/core/stringpool.cpp
View file @
1a07ff88
...
@@ -36,4 +36,10 @@ llvm::StringRef InternedString::s() const {
...
@@ -36,4 +36,10 @@ llvm::StringRef InternedString::s() const {
const
char
*
InternedString
::
c_str
()
const
{
const
char
*
InternedString
::
c_str
()
const
{
return
_str
->
c_str
();
return
_str
->
c_str
();
}
}
bool
InternedString
::
isCompilerCreatedName
()
const
{
char
c
=
_str
->
s
()[
0
];
return
c
==
'!'
||
c
==
'#'
;
}
}
}
src/core/stringpool.h
View file @
1a07ff88
...
@@ -82,6 +82,8 @@ public:
...
@@ -82,6 +82,8 @@ public:
operator
llvm
::
StringRef
()
const
{
return
s
();
}
operator
llvm
::
StringRef
()
const
{
return
s
();
}
operator
BoxedString
*
()
const
{
return
getBox
();
}
operator
BoxedString
*
()
const
{
return
getBox
();
}
bool
isCompilerCreatedName
()
const
;
friend
class
InternedStringPool
;
friend
class
InternedStringPool
;
friend
struct
std
::
hash
<
InternedString
>
;
friend
struct
std
::
hash
<
InternedString
>
;
friend
struct
std
::
less
<
InternedString
>
;
friend
struct
std
::
less
<
InternedString
>
;
...
...
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