summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/LowerSetJmp.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-09-20 04:48:05 +0000
committerChris Lattner <sabre@nondot.org>2004-09-20 04:48:05 +0000
commitb12914bfc0f76a7a48357162d5f4c39a1343e69b (patch)
tree00bff0412482165a6d7d60775e4aeb6ebe3b4628 /lib/Transforms/IPO/LowerSetJmp.cpp
parentbba61c07ddca19f72b13dd5a410358d296ed1d6a (diff)
downloadllvm-b12914bfc0f76a7a48357162d5f4c39a1343e69b.tar.gz
llvm-b12914bfc0f76a7a48357162d5f4c39a1343e69b.tar.bz2
llvm-b12914bfc0f76a7a48357162d5f4c39a1343e69b.tar.xz
'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass. Instead of implementing Pass::run, then should implement ModulePass::runOnModule. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index ebd0500cba..4ad89b583c 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -64,7 +64,7 @@ namespace {
// class because it works on a module as a whole, not a function at a
// time.
- class LowerSetJmp : public Pass,
+ class LowerSetJmp : public ModulePass,
public InstVisitor<LowerSetJmp> {
// LLVM library functions...
Function* InitSJMap; // __llvm_sjljeh_init_setjmpmap
@@ -119,7 +119,7 @@ namespace {
void visitReturnInst(ReturnInst& RI);
void visitUnwindInst(UnwindInst& UI);
- bool run(Module& M);
+ bool runOnModule(Module& M);
bool doInitialization(Module& M);
};
@@ -129,8 +129,7 @@ namespace {
// run - Run the transformation on the program. We grab the function
// prototypes for longjmp and setjmp. If they are used in the program,
// then we can go directly to the places they're at and transform them.
-bool LowerSetJmp::run(Module& M)
-{
+bool LowerSetJmp::runOnModule(Module& M) {
bool Changed = false;
// These are what the functions are called.
@@ -509,8 +508,7 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II)
// visitReturnInst - We want to destroy the setjmp map upon exit from the
// function.
-void LowerSetJmp::visitReturnInst(ReturnInst& RI)
-{
+void LowerSetJmp::visitReturnInst(ReturnInst &RI) {
Function* Func = RI.getParent()->getParent();
new CallInst(DestroySJMap, make_vector<Value*>(GetSetJmpMap(Func), 0),
"", &RI);
@@ -518,15 +516,13 @@ void LowerSetJmp::visitReturnInst(ReturnInst& RI)
// visitUnwindInst - We want to destroy the setjmp map upon exit from the
// function.
-void LowerSetJmp::visitUnwindInst(UnwindInst& UI)
-{
+void LowerSetJmp::visitUnwindInst(UnwindInst &UI) {
Function* Func = UI.getParent()->getParent();
new CallInst(DestroySJMap, make_vector<Value*>(GetSetJmpMap(Func), 0),
"", &UI);
}
-Pass* llvm::createLowerSetJmpPass()
-{
+ModulePass *llvm::createLowerSetJmpPass() {
return new LowerSetJmp();
}