Verify variable directly.
[oota-llvm.git] / lib / Analysis / ProfileInfoLoaderPass.cpp
index 84af53feb50fb8de9a0d63cbdfd96162bf135881..8ea4ecf54f98f6a8510b55e670afcd50ad63aa4f 100644 (file)
@@ -63,6 +63,16 @@ namespace {
     virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, double &);
     virtual void readEdge(ProfileInfo::Edge, std::vector<unsigned>&);
 
+    /// getAdjustedAnalysisPointer - This method is used when a pass implements
+    /// an analysis interface through multiple inheritance.  If needed, it
+    /// should override this to adjust the this pointer as needed for the
+    /// specified pass info.
+    virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) {
+      if (PI->isPassID(&ProfileInfo::ID))
+        return (ProfileInfo*)this;
+      return this;
+    }
+    
     /// run - Load the profile information from the specified file.
     virtual bool runOnModule(Module &M);
   };
@@ -109,7 +119,7 @@ void LoaderPass::recurseBasicBlock(const BasicBlock *BB) {
        bbi != bbe; ++bbi) {
     recurseBasicBlock(*bbi);
   }
-  for (pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
+  for (const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
        bbi != bbe; ++bbi) {
     recurseBasicBlock(*bbi);
   }
@@ -161,7 +171,7 @@ bool LoaderPass::runOnModule(Module &M) {
       }
     }
     if (ReadCount != Counters.size()) {
-      dbgs() << "WARNING: profile information is inconsistent with "
+      errs() << "WARNING: profile information is inconsistent with "
              << "the current program!\n";
     }
     NumEdgesRead = ReadCount;
@@ -209,7 +219,7 @@ bool LoaderPass::runOnModule(Module &M) {
       }
     }
     if (ReadCount != Counters.size()) {
-      dbgs() << "WARNING: profile information is inconsistent with "
+      errs() << "WARNING: profile information is inconsistent with "
              << "the current program!\n";
     }
     NumEdgesRead = ReadCount;
@@ -230,7 +240,7 @@ bool LoaderPass::runOnModule(Module &M) {
           BlockInformation[F][BB] = (double)Counters[ReadCount++];
     }
     if (ReadCount != Counters.size()) {
-      dbgs() << "WARNING: profile information is inconsistent with "
+      errs() << "WARNING: profile information is inconsistent with "
              << "the current program!\n";
     }
   }
@@ -249,7 +259,7 @@ bool LoaderPass::runOnModule(Module &M) {
         FunctionInformation[F] = (double)Counters[ReadCount++];
     }
     if (ReadCount != Counters.size()) {
-      dbgs() << "WARNING: profile information is inconsistent with "
+      errs() << "WARNING: profile information is inconsistent with "
              << "the current program!\n";
     }
   }