The InReg parameter attribute is valid on function results. The llvm-gcc-4.0
[oota-llvm.git] / lib / Analysis / ProfileInfoLoaderPass.cpp
index 08a45c62c55b08038e6393ccc7148dcf1852fed1..e749375723391d544f7ac95bf188c4c3d399c799 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/Analysis/ProfileInfo.h"
 #include "llvm/Analysis/ProfileInfoLoader.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 using namespace llvm;
 
@@ -28,11 +29,12 @@ namespace {
                       cl::value_desc("filename"),
                       cl::desc("Profile file loaded by -profile-loader"));
 
-  class LoaderPass : public ModulePass, public ProfileInfo {
+  class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
     std::string Filename;
   public:
+    static char ID; // Class identification, replacement for typeinfo
     LoaderPass(const std::string &filename = "")
-      : Filename(filename) {
+      : ModulePass((intptr_t)&ID), Filename(filename) {
       if (filename.empty()) Filename = ProfileInfoFilename;
     }
 
@@ -48,6 +50,7 @@ namespace {
     virtual bool runOnModule(Module &M);
   };
 
+  char LoaderPass::ID = 0;
   RegisterPass<LoaderPass>
   X("profile-loader", "Load profile information from llvmprof.out");
 
@@ -76,8 +79,8 @@ bool LoaderPass::runOnModule(Module &M) {
     TerminatorInst *TI = BB->getTerminator();
     if (SuccNum >= TI->getNumSuccessors()) {
       if (!PrintedWarning) {
-        llvm_cerr << "WARNING: profile information is inconsistent with "
-                  << "the current program!\n";
+        cerr << "WARNING: profile information is inconsistent with "
+             << "the current program!\n";
         PrintedWarning = true;
       }
     } else {