Wrap const MDNode * inside DIDescriptor.
[oota-llvm.git] / tools / bugpoint / TestPasses.cpp
index 5147a9070707ba44ce22d3d2d4b2723f186e6809..900bf632a83bb1552d527469c1b3cb27bf8d6d39 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -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 char ID; // Pass ID, replacement for typeid
+    CrashOnCalls() : BasicBlockPass(&ID) {}
+  private:
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
     }
@@ -38,6 +42,7 @@ namespace {
     }
   };
 
+  char 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 char ID; // Pass ID, replacement for typeid
+    DeleteCalls() : BasicBlockPass(&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;
     }
   };
-
+  char DeleteCalls::ID = 0;
   RegisterPass<DeleteCalls>
   Y("bugpoint-deletecalls",
     "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts");