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
307c2a08
Commit
307c2a08
authored
May 19, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to smallvectors here
parent
413d0226
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/core/ast.cpp
src/core/ast.cpp
+1
-1
src/core/ast.h
src/core/ast.h
+1
-1
src/core/cfg.h
src/core/cfg.h
+3
-3
No files found.
src/core/ast.cpp
View file @
307c2a08
...
@@ -2223,7 +2223,7 @@ public:
...
@@ -2223,7 +2223,7 @@ public:
}
}
};
};
void
flatten
(
const
std
::
vector
<
AST_stmt
*
>&
roots
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
)
{
void
flatten
(
const
llvm
::
SmallVector
<
AST_stmt
*
,
4
>&
roots
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
)
{
FlattenVisitor
visitor
(
&
output
,
expand_scopes
);
FlattenVisitor
visitor
(
&
output
,
expand_scopes
);
for
(
int
i
=
0
;
i
<
roots
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
roots
.
size
();
i
++
)
{
...
...
src/core/ast.h
View file @
307c2a08
...
@@ -1432,7 +1432,7 @@ public:
...
@@ -1432,7 +1432,7 @@ public:
// Given an AST node, return a vector of the node plus all its descendents.
// Given an AST node, return a vector of the node plus all its descendents.
// This is useful for analyses that care more about the constituent nodes than the
// This is useful for analyses that care more about the constituent nodes than the
// exact tree structure; ex, finding all "global" directives.
// exact tree structure; ex, finding all "global" directives.
void
flatten
(
const
std
::
vector
<
AST_stmt
*
>&
roots
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
);
void
flatten
(
const
llvm
::
SmallVector
<
AST_stmt
*
,
4
>&
roots
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
);
void
flatten
(
AST_expr
*
root
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
);
void
flatten
(
AST_expr
*
root
,
std
::
vector
<
AST
*>&
output
,
bool
expand_scopes
);
// Similar to the flatten() function, but filters for a specific type of ast nodes:
// Similar to the flatten() function, but filters for a specific type of ast nodes:
template
<
class
T
,
class
R
>
void
findNodes
(
const
R
&
roots
,
std
::
vector
<
T
*>&
output
,
bool
expand_scopes
)
{
template
<
class
T
,
class
R
>
void
findNodes
(
const
R
&
roots
,
std
::
vector
<
T
*>&
output
,
bool
expand_scopes
)
{
...
...
src/core/cfg.h
View file @
307c2a08
...
@@ -53,12 +53,12 @@ public:
...
@@ -53,12 +53,12 @@ public:
// contains the address of the entry function
// contains the address of the entry function
std
::
pair
<
CFGBlock
*
,
Box
*>
(
*
entry_code
)(
void
*
interpeter
,
CFGBlock
*
block
,
Box
**
vregs
);
std
::
pair
<
CFGBlock
*
,
Box
*>
(
*
entry_code
)(
void
*
interpeter
,
CFGBlock
*
block
,
Box
**
vregs
);
std
::
vector
<
AST_stmt
*
>
body
;
llvm
::
SmallVector
<
AST_stmt
*
,
4
>
body
;
std
::
vector
<
CFGBlock
*
>
predecessors
,
successors
;
llvm
::
SmallVector
<
CFGBlock
*
,
2
>
predecessors
,
successors
;
int
idx
;
// index in the CFG
int
idx
;
// index in the CFG
const
char
*
info
;
const
char
*
info
;
typedef
std
::
vector
<
AST_stmt
*
>::
iterator
iterator
;
typedef
llvm
::
SmallVector
<
AST_stmt
*
,
4
>::
iterator
iterator
;
CFGBlock
(
CFG
*
cfg
,
int
idx
)
:
cfg
(
cfg
),
code
(
NULL
),
entry_code
(
NULL
),
idx
(
idx
),
info
(
NULL
)
{}
CFGBlock
(
CFG
*
cfg
,
int
idx
)
:
cfg
(
cfg
),
code
(
NULL
),
entry_code
(
NULL
),
idx
(
idx
),
info
(
NULL
)
{}
...
...
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