Optimize code placement in loop to eliminate unconditional branches or move unconditi...
[oota-llvm.git] / lib / Analysis / ProfileInfoLoaderPass.cpp
index e18625f8e76514ee814b2299ecdec06363f44dd0..0a8a87bd0f97aaf5e64f1f8f42bb7e5dd2527d6a 100644 (file)
 #include "llvm/Support/Streams.h"
 using namespace llvm;
 
-namespace {
-  cl::opt<std::string>
-  ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
-                      cl::value_desc("filename"),
-                      cl::desc("Profile file loaded by -profile-loader"));
+static cl::opt<std::string>
+ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
+                    cl::value_desc("filename"),
+                    cl::desc("Profile file loaded by -profile-loader"));
 
+namespace {
   class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
     std::string Filename;
   public:
     static char ID; // Class identification, replacement for typeinfo
     explicit LoaderPass(const std::string &filename = "")
-      : ModulePass((intptr_t)&ID), Filename(filename) {
+      : ModulePass(&ID), Filename(filename) {
       if (filename.empty()) Filename = ProfileInfoFilename;
     }
 
@@ -46,19 +46,16 @@ namespace {
       return "Profiling information loader";
     }
 
-    /// isAnalysis - Return true if this pass is  implementing an analysis pass.
-    virtual bool isAnalysis() const { return true; }
-
     /// run - Load the profile information from the specified file.
     virtual bool runOnModule(Module &M);
   };
+}  // End of anonymous namespace
 
-  char LoaderPass::ID = 0;
-  RegisterPass<LoaderPass>
-  X("profile-loader", "Load profile information from llvmprof.out");
+char LoaderPass::ID = 0;
+static RegisterPass<LoaderPass>
+X("profile-loader", "Load profile information from llvmprof.out", false, true);
 
-  RegisterAnalysisGroup<ProfileInfo> Y(X);
-}  // End of anonymous namespace
+static RegisterAnalysisGroup<ProfileInfo> Y(X);
 
 ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }