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
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 1ff06f8..e4eb32f 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -305,7 +305,11 @@
/// BlocksToNotExtract list.
class BlockExtractorPass : public ModulePass {
bool runOnModule(Module &M);
+ public:
+ static const int ID; // Pass ID, replacement for typeid
+ BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
};
+ const int BlockExtractorPass::ID = 0;
RegisterPass<BlockExtractorPass>
XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)");
}
diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp
index 5147a90..a3fc149 100644
--- a/tools/bugpoint/TestPasses.cpp
+++ b/tools/bugpoint/TestPasses.cpp
@@ -25,6 +25,10 @@
/// CrashOnCalls - This pass is used to test bugpoint. It intentionally
/// crashes on any call instructions.
class CrashOnCalls : public BasicBlockPass {
+ public:
+ static const int ID; // Pass ID, replacement for typeid
+ CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {}
+ private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
@@ -38,6 +42,7 @@
}
};
+ const int CrashOnCalls::ID = 0;
RegisterPass<CrashOnCalls>
X("bugpoint-crashcalls",
"BugPoint Test Pass - Intentionally crash on CallInsts");
@@ -47,6 +52,10 @@
/// DeleteCalls - This pass is used to test bugpoint. It intentionally
/// deletes some call instructions, "misoptimizing" the program.
class DeleteCalls : public BasicBlockPass {
+ public:
+ static const int ID; // Pass ID, replacement for typeid
+ DeleteCalls() : BasicBlockPass((intptr_t)&ID) {}
+ private:
bool runOnBasicBlock(BasicBlock &BB) {
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
if (CallInst *CI = dyn_cast<CallInst>(I)) {
@@ -58,7 +67,8 @@
return false;
}
};
-
+
+ const int DeleteCalls::ID = 0;
RegisterPass<DeleteCalls>
Y("bugpoint-deletecalls",
"BugPoint Test Pass - Intentionally 'misoptimize' CallInsts");