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
048c6eaf
Commit
048c6eaf
authored
Nov 17, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
コマンドラインオプションのサンプルを追加
parent
97558d89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
BlockCounterPass.cpp
src/nykk/pass/BlockCounterPass.cpp
+4
-1
TestPass.cpp
src/nykk/pass/TestPass.cpp
+11
-1
No files found.
src/nykk/pass/BlockCounterPass.cpp
View file @
048c6eaf
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
#include <llvm/Pass.h>
#include <llvm/Pass.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/CommandLine.h>
namespace
namespace
{
{
/**
/**
...
@@ -82,7 +84,8 @@ namespace
...
@@ -82,7 +84,8 @@ namespace
char
BlockCounterPass
::
ID
;
char
BlockCounterPass
::
ID
;
// Register pass.
// Register pass.
llvm
::
RegisterPass
<
BlockCounterPass
>
pass_registry
{
const
llvm
::
RegisterPass
<
BlockCounterPass
>
pass_registry
=
{
"count-block"
,
"count-block"
,
"IR analyzer"
,
"IR analyzer"
,
};
};
...
...
src/nykk/pass/TestPass.cpp
View file @
048c6eaf
...
@@ -5,6 +5,14 @@
...
@@ -5,6 +5,14 @@
namespace
namespace
{
{
const
llvm
::
cl
::
opt
<
int
>
test_opt
{
"test_opt"
,
llvm
::
cl
::
desc
(
"Test pass option"
),
llvm
::
cl
::
value_desc
(
"test"
),
llvm
::
cl
::
init
(
10
),
};
/**
/**
* @brief First watermarker pass.
* @brief First watermarker pass.
*/
*/
...
@@ -41,6 +49,7 @@ namespace
...
@@ -41,6 +49,7 @@ namespace
bool
doInitialization
(
llvm
::
Module
&
module
)
override
bool
doInitialization
(
llvm
::
Module
&
module
)
override
{
{
llvm
::
errs
()
<<
__FUNCTION__
<<
" : "
<<
module
.
getName
()
<<
"
\n
"
;
llvm
::
errs
()
<<
__FUNCTION__
<<
" : "
<<
module
.
getName
()
<<
"
\n
"
;
llvm
::
errs
()
<<
"test_opt: "
<<
test_opt
<<
"
\n
"
;
return
false
;
return
false
;
}
}
...
@@ -90,7 +99,8 @@ namespace
...
@@ -90,7 +99,8 @@ namespace
char
TestPass
::
ID
;
char
TestPass
::
ID
;
// Register pass.
// Register pass.
llvm
::
RegisterPass
<
TestPass
>
test_pass_registry
{
const
llvm
::
RegisterPass
<
TestPass
>
pass_registry
=
{
"testpass"
,
"testpass"
,
"Test pass"
,
"Test pass"
,
};
};
...
...
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