Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
3d7720ae
Commit
3d7720ae
authored
22 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs in previous checkins
llvm-svn: 3673
parent
9674b869
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+4
-4
4 additions, 4 deletions
llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
with
4 additions
and
4 deletions
llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+
4
−
4
View file @
3d7720ae
...
...
@@ -49,8 +49,8 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
if
(
F
.
getReturnType
()
!=
Type
::
VoidTy
)
{
// If the function doesn't return void... add a PHI node to the block...
PHINode
*
PN
=
new
PHINode
(
F
.
getReturnType
(),
"UnifiedRetVal"
,
NewRetBlock
->
end
()
);
PHINode
*
PN
=
new
PHINode
(
F
.
getReturnType
(),
"UnifiedRetVal"
);
NewRetBlock
->
getInstList
().
push_back
(
PN
);
// Add an incoming element to the PHI node for every return instruction that
// is merging into this new block...
...
...
@@ -59,7 +59,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
PN
->
addIncoming
((
*
I
)
->
getTerminator
()
->
getOperand
(
0
),
*
I
);
// Add a return instruction to return the result of the PHI node...
n
ew
Ret
urnInst
(
PN
,
N
ewRet
Block
->
end
(
));
N
ewRet
Block
->
getInstList
().
push_back
(
n
ew
Ret
urnInst
(
PN
));
}
else
{
// If it returns void, just add a return void instruction to the block
new
ReturnInst
(
0
,
NewRetBlock
->
end
());
...
...
@@ -71,7 +71,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
for
(
vector
<
BasicBlock
*>::
iterator
I
=
ReturningBlocks
.
begin
(),
E
=
ReturningBlocks
.
end
();
I
!=
E
;
++
I
)
{
(
*
I
)
->
getInstList
().
pop_back
();
// Remove the return insn
new
BranchInst
(
NewRetBlock
,
(
*
I
)
->
end
(
));
(
*
I
)
->
getInstList
().
push_back
(
new
BranchInst
(
NewRetBlock
));
}
ExitNode
=
NewRetBlock
;
return
true
;
...
...
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