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
1f5c48fc
Commit
1f5c48fc
authored
Nov 15, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2,3番目のBasicBlockのスワップを実装
parent
1ea3bab5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
.gitignore
.gitignore
+1
-0
TestPass.cpp
src/nykk/TestPass.cpp
+14
-1
No files found.
.gitignore
View file @
1f5c48fc
...
...
@@ -5,3 +5,4 @@
*.dll
*.o
*.ll
*.s
src/nykk/TestPass.cpp
View file @
1f5c48fc
...
...
@@ -41,7 +41,20 @@ namespace nykk
bool
TestPass
::
runOnFunction
(
llvm
::
Function
&
func
)
{
llvm
::
errs
()
<<
__FUNCTION__
<<
" : "
<<
func
.
getName
()
<<
"
\n
"
;
llvm
::
errs
()
<<
" "
<<
"bbs : "
<<
func
.
getBasicBlockList
().
size
()
<<
"
\n
"
;
return
false
;
if
(
func
.
getBasicBlockList
().
size
()
<
3
)
{
return
false
;
}
// Swap 2nd and 3rd basic blocks.
llvm
::
BasicBlock
&
entry_bb
=
func
.
getEntryBlock
();
llvm
::
BasicBlock
*
bb1
=
entry_bb
.
getNextNode
();
llvm
::
BasicBlock
*
bb2
=
bb1
->
getNextNode
();
bb1
->
moveAfter
(
bb2
);
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