Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
llvm-pass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
llvm-pass
Commits
b79af324
Commit
b79af324
authored
6 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
function
parent
bfddf4b7
No related branches found
No related tags found
No related merge requests found
Pipeline
#77
canceled
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
skeleton/Skeleton.cpp
+28
-12
28 additions, 12 deletions
skeleton/Skeleton.cpp
with
28 additions
and
12 deletions
skeleton/Skeleton.cpp
+
28
−
12
View file @
b79af324
...
...
@@ -3,26 +3,42 @@
#include
"llvm/Support/raw_ostream.h"
#include
"llvm/IR/LegacyPassManager.h"
#include
"llvm/Transforms/IPO/PassManagerBuilder.h"
#include
"llvm/Analysis/Trace.h"
#include
"llvm/IR/BasicBlock.h"
using
namespace
llvm
;
namespace
{
struct
SkeletonPass
:
public
FunctionPass
{
namespace
{
struct
SkeletonPass
:
public
FunctionPass
{
static
char
ID
;
SkeletonPass
()
:
FunctionPass
(
ID
)
{}
virtual
bool
runOnFunction
(
Function
&
F
)
{
errs
()
<<
"I saw a function called "
<<
F
.
getName
()
<<
"!
\n
"
;
virtual
bool
runOnFunction
(
Function
&
F
)
{
errs
()
<<
"Function "
<<
F
.
getName
()
<<
"!
\n
"
;
for
(
Function
::
BasicBlockListType
::
iterator
i
=
F
.
begin
(),
ie
=
F
.
end
();
i
!=
ie
;
++
i
)
{
for
(
llvm
::
BasicBlock
::
InstListType
::
iterator
j
=
i
->
begin
(),
je
=
i
->
end
();
j
!=
je
;
++
j
)
{
Instruction
*
ii
=
&*
j
;
errs
()
<<
*
ii
<<
"
\n
"
;
}
}
return
false
;
}
};
}
}
// namespace
char
SkeletonPass
::
ID
=
0
;
// Automatically enable the pass.
// http://adriansampson.net/blog/clangpass.html
static
void
registerSkeletonPass
(
const
PassManagerBuilder
&
,
legacy
::
PassManagerBase
&
PM
)
{
legacy
::
PassManagerBase
&
PM
)
{
PM
.
add
(
new
SkeletonPass
());
}
static
RegisterStandardPasses
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment