mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
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
This commit is contained in:
@@ -35,6 +35,8 @@ namespace {
|
||||
// DeadInstElimination pass implementation
|
||||
//
|
||||
struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass {
|
||||
static const int ID; // Pass identifcation, replacement for typeid
|
||||
DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); )
|
||||
@@ -51,6 +53,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
const int DeadInstElimination::ID = 0;
|
||||
RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
|
||||
}
|
||||
|
||||
@@ -64,6 +67,9 @@ namespace {
|
||||
// DeadCodeElimination pass implementation
|
||||
//
|
||||
struct DCE : public FunctionPass {
|
||||
static const int ID; // Pass identifcation, replacement for typeid
|
||||
DCE() : FunctionPass((intptr_t)&ID) {}
|
||||
|
||||
virtual bool runOnFunction(Function &F);
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
@@ -71,6 +77,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
const int DCE::ID = 0;
|
||||
RegisterPass<DCE> Y("dce", "Dead Code Elimination");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user