Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
fd77caab
Verified
Commit
fd77caab
authored
Dec 12, 2020
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix embedding method
parent
8b368114
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
Reordering-inl.hpp
lib/kyut/Reordering-inl.hpp
+4
-1
SafeUnique.hpp
lib/kyut/SafeUnique.hpp
+2
-3
Compare-inl.hpp
lib/kyut/wasm-ext/Compare-inl.hpp
+12
-0
No files found.
lib/kyut/Reordering-inl.hpp
View file @
fd77caab
...
...
@@ -105,7 +105,10 @@ namespace kyut {
const
auto
it
=
chunk_begin
+
i
;
// Find the position of `begin + i`.
const
auto
found
=
std
::
find
(
it
,
std
::
end
(
chunk
),
begin
+
i
);
const
auto
found
=
std
::
find_if
(
it
,
std
::
end
(
chunk
),
[
&
](
const
auto
&
a
)
{
return
!
less
(
*
a
,
*
(
begin
+
i
))
&&
!
less
(
*
(
begin
+
i
),
*
a
);
});
assert
(
found
!=
std
::
end
(
chunk
));
const
std
::
size_t
pos
=
std
::
distance
(
it
,
found
);
...
...
lib/kyut/SafeUnique.hpp
View file @
fd77caab
...
...
@@ -15,15 +15,14 @@ namespace kyut {
std
::
vector
<
typename
std
::
iterator_traits
<
Iterator
>::
value_type
>
a
,
b
;
auto
it
=
begin
;
a
.
emplace_back
(
std
::
move
(
*
it
++
));
a
.
emplace_back
(
std
::
move
(
*
it
));
while
(
it
!=
end
)
{
while
(
++
it
!=
end
)
{
if
(
pred
(
a
.
back
(),
*
it
))
{
b
.
emplace_back
(
std
::
move
(
*
it
));
}
else
{
a
.
emplace_back
(
std
::
move
(
*
it
));
}
++
it
;
}
it
=
begin
;
...
...
lib/kyut/wasm-ext/Compare-inl.hpp
View file @
fd77caab
...
...
@@ -22,6 +22,10 @@ namespace wasm {
return
*
p
;
};
if
(
&
a
==
&
b
)
{
return
false
;
}
if
(
a
.
_id
!=
b
.
_id
)
{
return
a
.
_id
<
b
.
_id
;
}
...
...
@@ -347,6 +351,10 @@ namespace wasm {
}
inline
bool
operator
<
(
const
ExpressionList
&
a
,
const
ExpressionList
&
b
)
{
if
(
&
a
==
&
b
)
{
return
false
;
}
if
(
a
.
size
()
!=
b
.
size
())
{
return
a
.
size
()
<
b
.
size
();
}
...
...
@@ -362,6 +370,10 @@ namespace wasm {
}
inline
bool
operator
<
(
const
Function
&
a
,
const
Function
&
b
)
{
if
(
&
a
==
&
b
)
{
return
false
;
}
// wasm::Function::getNumVars() does not modify states
return
std
::
forward_as_tuple
(
a
.
sig
,
const_cast
<
Function
&>
(
a
).
getNumVars
(),
*
a
.
body
)
<
std
::
forward_as_tuple
(
b
.
sig
,
const_cast
<
Function
&>
(
b
).
getNumVars
(),
*
b
.
body
);
...
...
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