Do not use typeinfo to identify pass in pass manager.
[oota-llvm.git] / lib / Transforms / IPO / GlobalDCE.cpp
index 56879e2b1362e83e512d4f9ec6a67365327e214c..00b16a839e3f951f95f2299218d2cbded5d04f27 100644 (file)
@@ -30,6 +30,9 @@ STATISTIC(NumVariables, "Number of global variables removed");
 
 namespace {
   struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass {
+    static const int ID; // Pass identifcation, replacement for typeid
+    GlobalDCE() : ModulePass((intptr_t)&ID) {}
     // run - Do the GlobalDCE pass on the specified module, optionally updating
     // the specified callgraph to reflect the changes.
     //
@@ -46,6 +49,7 @@ namespace {
     bool SafeToDestroyConstant(Constant* C);
     bool RemoveUnusedGlobalValue(GlobalValue &GV);
   };
+  const int GlobalDCE::ID = 0;
   RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
 }