aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
committerDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
commit794fd75c67a2cdc128d67342c6d88a504d186896 (patch)
tree6b805aa4a576e9de6cbf096d2fb85063b3fb8fca /lib/Transforms/Utils
parente50fb9ac174b791047ffa8648443ab94b2097cd9 (diff)
downloadexternal_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.zip
external_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.gz
external_llvm-794fd75c67a2cdc128d67342c6d88a504d186896.tar.bz2
Do not use typeinfo to identify pass in pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp4
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp4
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp4
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp5
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp5
-rw-r--r--lib/Transforms/Utils/LowerSelect.cpp5
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp4
-rw-r--r--lib/Transforms/Utils/Mem2Reg.cpp4
-rw-r--r--lib/Transforms/Utils/UnifyFunctionExitNodes.cpp1
9 files changed, 33 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index 7761e93..561b71d 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -34,6 +34,9 @@ STATISTIC(NumBroken, "Number of blocks inserted");
namespace {
struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {}
+
virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -47,6 +50,7 @@ namespace {
}
};
+ const int BreakCriticalEdges::ID = 0;
RegisterPass<BreakCriticalEdges> X("break-crit-edges",
"Break critical edges in CFG");
}
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index 0c223c5..e46e35b 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/lib/Transforms/Utils/LCSSA.cpp
@@ -47,6 +47,9 @@ STATISTIC(NumLCSSA, "Number of live out of a loop variables");
namespace {
struct VISIBILITY_HIDDEN LCSSA : public FunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ LCSSA() : FunctionPass((intptr_t)&ID) {}
+
// Cached analysis information for the current function.
LoopInfo *LI;
DominatorTree *DT;
@@ -81,6 +84,7 @@ namespace {
}
};
+ const int LCSSA::ID = 0;
RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp
index d27bc8c..cea0bca 100644
--- a/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/lib/Transforms/Utils/LoopSimplify.cpp
@@ -54,6 +54,9 @@ STATISTIC(NumNested , "Number of nested loops split out");
namespace {
struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ LoopSimplify() : FunctionPass((intptr_t)&ID) {}
+
// AA - If we have an alias analysis object to update, this is it, otherwise
// this is null.
AliasAnalysis *AA;
@@ -89,6 +92,7 @@ namespace {
std::vector<BasicBlock*> &PredBlocks);
};
+ const int LoopSimplify::ID = 0;
RegisterPass<LoopSimplify>
X("loopsimplify", "Canonicalize natural loops", true);
}
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index cb2f885..0ecc775 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -36,8 +36,10 @@ namespace {
Constant *FreeFunc; // Initialized by doInitialization
bool LowerMallocArgToInteger;
public:
+ static const int ID; // Pass ID, replacement for typeid
LowerAllocations(bool LowerToInt = false)
- : MallocFunc(0), FreeFunc(0), LowerMallocArgToInteger(LowerToInt) {}
+ : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0),
+ LowerMallocArgToInteger(LowerToInt) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
@@ -66,6 +68,7 @@ namespace {
bool runOnBasicBlock(BasicBlock &BB);
};
+ const int LowerAllocations::ID = 0;
RegisterPass<LowerAllocations>
X("lowerallocs", "Lower allocations from instructions to calls");
}
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index e0332d2..3f8d06f 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -75,7 +75,9 @@ namespace {
const TargetLowering *TLI;
public:
- LowerInvoke(const TargetLowering *tli = NULL) : TLI(tli) { }
+ static const int ID; // Pass identifcation, replacement for typeid
+ LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID),
+ TLI(tli) { }
bool doInitialization(Module &M);
bool runOnFunction(Function &F);
@@ -97,6 +99,7 @@ namespace {
bool insertExpensiveEHSupport(Function &F);
};
+ const int LowerInvoke::ID = 0;
RegisterPass<LowerInvoke>
X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}
diff --git a/lib/Transforms/Utils/LowerSelect.cpp b/lib/Transforms/Utils/LowerSelect.cpp
index 120c3b1..fda26c9 100644
--- a/lib/Transforms/Utils/LowerSelect.cpp
+++ b/lib/Transforms/Utils/LowerSelect.cpp
@@ -33,7 +33,9 @@ namespace {
class VISIBILITY_HIDDEN LowerSelect : public FunctionPass {
bool OnlyFP; // Only lower FP select instructions?
public:
- LowerSelect(bool onlyfp = false) : OnlyFP(onlyfp) {}
+ static const int ID; // Pass identifcation, replacement for typeid
+ LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID),
+ OnlyFP(onlyfp) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
// This certainly destroys the CFG.
@@ -48,6 +50,7 @@ namespace {
bool runOnFunction(Function &F);
};
+ const int LowerSelect::ID = 0;
RegisterPass<LowerSelect>
X("lowerselect", "Lower select instructions to branches");
}
diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp
index 61fa85c..482ada9 100644
--- a/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/lib/Transforms/Utils/LowerSwitch.cpp
@@ -30,6 +30,9 @@ namespace {
/// modifies the CFG!
class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass {
public:
+ static const int ID; // Pass identifcation, replacement for typeid
+ LowerSwitch() : FunctionPass((intptr_t) &ID) {}
+
virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -75,6 +78,7 @@ namespace {
}
};
+ const int LowerSwitch::ID = 0;
RegisterPass<LowerSwitch>
X("lowerswitch", "Lower SwitchInst's to branches");
}
diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp
index 7d69fd2..37bc318 100644
--- a/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/lib/Transforms/Utils/Mem2Reg.cpp
@@ -27,6 +27,9 @@ STATISTIC(NumPromoted, "Number of alloca's promoted");
namespace {
struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ PromotePass() : FunctionPass((intptr_t)&ID) {}
+
// runOnFunction - To run this pass, first we calculate the alloca
// instructions that are safe for promotion, then we promote each one.
//
@@ -47,6 +50,7 @@ namespace {
}
};
+ const int PromotePass::ID = 0;
RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
} // end of anonymous namespace
diff --git a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index 07512b9..f7dd113 100644
--- a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@ -22,6 +22,7 @@
#include "llvm/Type.h"
using namespace llvm;
+const int UnifyFunctionExitNodes::ID = 0;
static RegisterPass<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");