diff options
| author | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-05-01 21:15:47 +0000 |
| commit | 09f162ca6a10446d6377b957f3a58ac92ce38306 (patch) | |
| tree | b41e816449956582e447ab616707e1afbf1a88fe /llvm/tools/bugpoint | |
| parent | a612049dd849d1e659eeaeefbcf82147af7f669f (diff) | |
| download | bcm5719-llvm-09f162ca6a10446d6377b957f3a58ac92ce38306.tar.gz bcm5719-llvm-09f162ca6a10446d6377b957f3a58ac92ce38306.zip | |
Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
Diffstat (limited to 'llvm/tools/bugpoint')
| -rw-r--r-- | llvm/tools/bugpoint/ExtractFunction.cpp | 4 | ||||
| -rw-r--r-- | llvm/tools/bugpoint/TestPasses.cpp | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp index 1ff06f88b1c..e4eb32f07a5 100644 --- a/llvm/tools/bugpoint/ExtractFunction.cpp +++ b/llvm/tools/bugpoint/ExtractFunction.cpp @@ -305,7 +305,11 @@ namespace { /// 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/llvm/tools/bugpoint/TestPasses.cpp b/llvm/tools/bugpoint/TestPasses.cpp index 5147a907070..a3fc1496125 100644 --- a/llvm/tools/bugpoint/TestPasses.cpp +++ b/llvm/tools/bugpoint/TestPasses.cpp @@ -25,6 +25,10 @@ namespace { /// 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 @@ namespace { } }; + const int CrashOnCalls::ID = 0; RegisterPass<CrashOnCalls> X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); @@ -47,6 +52,10 @@ namespace { /// 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 @@ namespace { return false; } }; - + + const int DeleteCalls::ID = 0; RegisterPass<DeleteCalls> Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); |

