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
7044c24c
Commit
7044c24c
authored
Jul 11, 2016
by
Kevin Modzelewski
Committed by
GitHub
Jul 11, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1291 from undingen/bitvector
VRegSet: use a llvm bitvector as representation
parents
ef007829
22087499
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
src/core/cfg.h
src/core/cfg.h
+7
-21
No files found.
src/core/cfg.h
View file @
7044c24c
...
...
@@ -29,6 +29,8 @@
#include <vector>
#include "llvm/ADT/BitVector.h"
#include "core/ast.h"
#include "core/common.h"
#include "core/stringpool.h"
...
...
@@ -203,8 +205,7 @@ public:
class
VRegSet
{
private:
// TODO: switch just to a bool*?
std
::
vector
<
bool
>
v
;
llvm
::
BitVector
v
;
public:
VRegSet
(
int
num_vregs
)
:
v
(
num_vregs
,
false
)
{}
...
...
@@ -219,13 +220,7 @@ public:
v
[
vreg
]
=
true
;
}
int
numSet
()
const
{
int
r
=
0
;
for
(
auto
b
:
v
)
if
(
b
)
r
++
;
return
r
;
}
int
numSet
()
const
{
return
v
.
count
();
}
class
iterator
{
public:
...
...
@@ -234,9 +229,7 @@ public:
iterator
(
const
VRegSet
&
set
,
int
i
)
:
set
(
set
),
i
(
i
)
{}
iterator
&
operator
++
()
{
do
{
i
++
;
}
while
(
i
<
set
.
v
.
size
()
&&
!
set
.
v
[
i
]);
i
=
set
.
v
.
find_next
(
i
);
return
*
this
;
}
...
...
@@ -246,15 +239,8 @@ public:
int
operator
*
()
{
return
i
;
}
};
iterator
begin
()
const
{
for
(
int
i
=
0
;
i
<
v
.
size
();
i
++
)
{
if
(
v
[
i
])
return
iterator
(
*
this
,
i
);
}
return
iterator
(
*
this
,
this
->
v
.
size
());
}
iterator
end
()
const
{
return
iterator
(
*
this
,
this
->
v
.
size
());
}
iterator
begin
()
const
{
return
iterator
(
*
this
,
v
.
find_first
());
}
iterator
end
()
const
{
return
iterator
(
*
this
,
-
1
);
}
};
// VRegMap: A compact way of representing a value per vreg.
...
...
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