Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLVM bpEVL
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Lorenzo Albano
LLVM bpEVL
Commits
7e5bd59d
Commit
7e5bd59d
authored
21 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
Finegrainify namespacification
Fix bug: LowerInvoke/2003-12-10-Crash.llx llvm-svn: 10382
parent
02f7e71d
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/Scalar/LowerInvoke.cpp
+11
-11
11 additions, 11 deletions
llvm/lib/Transforms/Scalar/LowerInvoke.cpp
with
11 additions
and
11 deletions
llvm/lib/Transforms/Scalar/LowerInvoke.cpp
+
11
−
11
View file @
7e5bd59d
...
...
@@ -22,8 +22,7 @@
#include
"llvm/Type.h"
#include
"llvm/Constant.h"
#include
"Support/Statistic.h"
namespace
llvm
{
using
namespace
llvm
;
namespace
{
Statistic
<>
NumLowered
(
"lowerinvoke"
,
"Number of invoke & unwinds replaced"
);
...
...
@@ -40,7 +39,7 @@ namespace {
}
// Public Interface To the LowerInvoke pass.
FunctionPass
*
createLowerInvokePass
()
{
return
new
LowerInvoke
();
}
FunctionPass
*
llvm
::
createLowerInvokePass
()
{
return
new
LowerInvoke
();
}
// doInitialization - Make sure that there is a prototype for abort in the
// current module.
...
...
@@ -51,8 +50,8 @@ bool LowerInvoke::doInitialization(Module &M) {
bool
LowerInvoke
::
runOnFunction
(
Function
&
F
)
{
bool
Changed
=
false
;
for
(
Function
::
iterator
I
=
F
.
begin
(),
E
=
F
.
end
();
I
!=
E
;
++
I
)
if
(
InvokeInst
*
II
=
dyn_cast
<
InvokeInst
>
(
I
->
getTerminator
()))
{
for
(
Function
::
iterator
BB
=
F
.
begin
(),
E
=
F
.
end
();
BB
!=
E
;
++
BB
)
if
(
InvokeInst
*
II
=
dyn_cast
<
InvokeInst
>
(
BB
->
getTerminator
()))
{
// Insert a normal call instruction...
std
::
string
Name
=
II
->
getName
();
II
->
setName
(
""
);
Value
*
NewCall
=
new
CallInst
(
II
->
getCalledValue
(),
...
...
@@ -60,14 +59,17 @@ bool LowerInvoke::runOnFunction(Function &F) {
II
->
op_end
()),
Name
,
II
);
II
->
replaceAllUsesWith
(
NewCall
);
// Insert an unconditional branch to the normal destination
// Insert an unconditional branch to the normal destination
.
new
BranchInst
(
II
->
getNormalDest
(),
II
);
// Remove any PHI node entries from the exception destination.
II
->
getExceptionalDest
()
->
removePredecessor
(
BB
);
// Remove the invoke instruction now.
I
->
getInstList
().
erase
(
II
);
BB
->
getInstList
().
erase
(
II
);
++
NumLowered
;
Changed
=
true
;
}
else
if
(
UnwindInst
*
UI
=
dyn_cast
<
UnwindInst
>
(
I
->
getTerminator
()))
{
}
else
if
(
UnwindInst
*
UI
=
dyn_cast
<
UnwindInst
>
(
BB
->
getTerminator
()))
{
// Insert a call to abort()
new
CallInst
(
AbortFn
,
std
::
vector
<
Value
*>
(),
""
,
UI
);
...
...
@@ -76,11 +78,9 @@ bool LowerInvoke::runOnFunction(Function &F) {
Constant
::
getNullValue
(
F
.
getReturnType
()),
UI
);
// Remove the unwind instruction now.
I
->
getInstList
().
erase
(
UI
);
BB
->
getInstList
().
erase
(
UI
);
++
NumLowered
;
Changed
=
true
;
}
return
Changed
;
}
}
// End llvm namespace
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