Add doInitialization and doFinalization methods to ModulePass's, to allow them to...
[oota-llvm.git] / tools / llvm-prof / llvm-prof.cpp
index d9b671336407e96e2f4f95f936711a3b0ac57738..940ac340e7c9c9fd09c5ab5c832074d379318254 100644 (file)
@@ -281,13 +281,15 @@ int main(int argc, char **argv) {
   // using the standard profile info provider pass, but for now this gives us
   // access to additional information not exposed via the ProfileInfo
   // interface.
-  ProfileInfoLoader PIL(argv[0], ProfileDataFile, *M);
+  ProfileInfoLoader PIL(argv[0], ProfileDataFile);
 
   // Run the printer pass.
   PassManager PassMgr;
   PassMgr.add(createProfileLoaderPass(ProfileDataFile));
   PassMgr.add(new ProfileInfoPrinterPass(PIL));
+  PassMgr.doInitialization();
   PassMgr.run(*M);
+  PassMgr.doFinalization();
 
   return 0;
 }