Add dump() routines to help debug debug info :)
[oota-llvm.git] / lib / VMCore / Pass.cpp
index e0fe6222b5010462990dff1a4460df0835c26df5..6db5d7e24c5ef2f4eec9eb5cc0680261411ba4a6 100644 (file)
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Pass.h"
 #include "llvm/PassManager.h"
 #include "llvm/Module.h"
 #include "llvm/ModuleProvider.h"
@@ -36,7 +37,7 @@ Pass::~Pass() {
 ModulePass::~ModulePass() { }
 
 bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
-  return Resolver->getAnalysisToUpdate(AnalysisID, true) != 0;
+  return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0;
 }
 
 // dumpPassStructure - Implement the -debug-passes=Structure option
@@ -145,7 +146,7 @@ public:
   void RegisterPass(const PassInfo &PI) {
     bool Inserted =
       PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second;
-    assert(Inserted && "Pass registered multiple times!");
+    assert(Inserted && "Pass registered multiple times!"); Inserted=Inserted;
   }
   
   void UnregisterPass(const PassInfo &PI) {
@@ -293,8 +294,9 @@ void PassRegistrationListener::enumeratePasses() {
 
 namespace {
   struct GetCFGOnlyPasses : public PassRegistrationListener {
-    std::vector<AnalysisID> &CFGOnlyList;
-    GetCFGOnlyPasses(std::vector<AnalysisID> &L) : CFGOnlyList(L) {}
+    typedef AnalysisUsage::VectorType VectorType;
+    VectorType &CFGOnlyList;
+    GetCFGOnlyPasses(VectorType &L) : CFGOnlyList(L) {}
     
     void passEnumerate(const PassInfo *P) {
       if (P->isCFGOnlyPass())