[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp TestPasses.cpp

Devang Patel dpatel at apple.com
Tue May 1 14:18:01 PDT 2007



Changes in directory llvm/tools/bugpoint:

ExtractFunction.cpp updated: 1.58 -> 1.59
TestPasses.cpp updated: 1.10 -> 1.11
---
Log message:

Do not use typeinfo to identify pass in pass manager.


---
Diffs of the changes:  (+15 -1)

 ExtractFunction.cpp |    4 ++++
 TestPasses.cpp      |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)


Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.58 llvm/tools/bugpoint/ExtractFunction.cpp:1.59
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.58	Mon Feb  5 14:47:21 2007
+++ llvm/tools/bugpoint/ExtractFunction.cpp	Tue May  1 16:15:47 2007
@@ -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)");
 }


Index: llvm/tools/bugpoint/TestPasses.cpp
diff -u llvm/tools/bugpoint/TestPasses.cpp:1.10 llvm/tools/bugpoint/TestPasses.cpp:1.11
--- llvm/tools/bugpoint/TestPasses.cpp:1.10	Thu Apr 21 18:59:23 2005
+++ llvm/tools/bugpoint/TestPasses.cpp	Tue May  1 16:15:47 2007
@@ -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");






More information about the llvm-commits mailing list