Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-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
llvm-watermarker
Commits
c1e3f5eb
Commit
c1e3f5eb
authored
Nov 26, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ログの出力形式を変更
parent
6eccca3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
analyze.zsh
scripts/analyze.zsh
+4
-4
BlockWatermarkPass.cpp
src/nykk/pass/BlockWatermarkPass.cpp
+5
-6
No files found.
scripts/analyze.zsh
View file @
c1e3f5eb
#!/bin/zsh
#!/bin/zsh
g
()
{
g
()
{
NAME
=
$1
SIZE
=
$(
stat
-c
%s
$1
)
SIZE
=
$(
stat
-c
%s
$NAME
)
LINES
=
$(
wc
-l
$1
|
awk
'{print $1+1}'
)
LINES
=
$(
wc
-l
$NAME
|
awk
'{print $1+1}'
)
echo
"
name,
$1
, size,
$SIZE
, lines
,
$LINES
"
echo
"
$1
,
$SIZE
,
$LINES
"
}
}
f
()
{
f
()
{
...
@@ -13,5 +12,6 @@ f() {
...
@@ -13,5 +12,6 @@ f() {
done
done
}
}
echo
"name, size, lines"
f example/8cc/8cc/
*
.c
f example/8cc/8cc/
*
.c
f example/zlib/zlib/
*
.c
f example/zlib/zlib/
*
.c
src/nykk/pass/BlockWatermarkPass.cpp
View file @
c1e3f5eb
...
@@ -99,6 +99,8 @@ namespace
...
@@ -99,6 +99,8 @@ namespace
perm_table_
=
nykk
::
create_permutation_table
(
partition_opt
.
getValue
().
value
);
perm_table_
=
nykk
::
create_permutation_table
(
partition_opt
.
getValue
().
value
);
bit_pos_
=
0
;
bit_pos_
=
0
;
llvm
::
errs
()
<<
"func"
<<
", "
<<
"blocks"
<<
", "
<<
"bits"
<<
"
\n
"
;
return
false
;
return
false
;
}
}
...
@@ -125,15 +127,13 @@ namespace
...
@@ -125,15 +127,13 @@ namespace
*/
*/
bool
runOnFunction
(
llvm
::
Function
&
func
)
override
bool
runOnFunction
(
llvm
::
Function
&
func
)
override
{
{
llvm
::
errs
()
llvm
::
errs
()
<<
func
.
getName
()
<<
", "
<<
func
.
size
()
<<
", "
;
<<
"[BlockWatermarker - '"
<<
func
.
getName
()
<<
"' in "
<<
module_name_
<<
"] Basic blocks: "
<<
func
.
size
()
<<
"
\n
"
;
const
auto
partition
=
partition_opt
.
getValue
().
value
;
const
auto
partition
=
partition_opt
.
getValue
().
value
;
if
(
func
.
size
()
<=
partition
)
if
(
func
.
size
()
<=
partition
)
{
{
llvm
::
errs
()
llvm
::
errs
()
<<
0
<<
"
\n
"
;
<<
" function '"
<<
func
.
getName
()
<<
"' is too small to watermark"
<<
"
\n
"
;
return
false
;
return
false
;
}
}
...
@@ -179,8 +179,7 @@ namespace
...
@@ -179,8 +179,7 @@ namespace
last_block
=
&
blocks
[
block_index
].
get
();
last_block
=
&
blocks
[
block_index
].
get
();
}
}
llvm
::
errs
()
llvm
::
errs
()
<<
num_embedded_bits
<<
"
\n
"
;
<<
" "
<<
num_embedded_bits
<<
"bit watermark embedded in function '"
<<
func
.
getName
()
<<
"'"
<<
"
\n
"
;
return
true
;
return
true
;
}
}
...
...
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