danielcdh updated this revision to Diff 108174. danielcdh added a comment. update
https://reviews.llvm.org/D35746 Files: lib/CodeGen/BackendUtil.cpp Index: lib/CodeGen/BackendUtil.cpp =================================================================== --- lib/CodeGen/BackendUtil.cpp +++ lib/CodeGen/BackendUtil.cpp @@ -855,10 +855,13 @@ if (!CodeGenOpts.SampleProfileFile.empty()) PGOOpt.SampleProfileFile = CodeGenOpts.SampleProfileFile; + if (CodeGenOpts.DebugInfoForProfiling) + PGOOpt.SampleProfileGen = true; + // Only pass a PGO options struct if -fprofile-generate or // -fprofile-use were passed on the cmdline. PassBuilder PB(TM.get(), - (PGOOpt.RunProfileGen || + (PGOOpt.RunProfileGen || PGOOpt.SampleProfileGen || !PGOOpt.ProfileUseFile.empty() || !PGOOpt.SampleProfileFile.empty()) ? Optional<PGOOptions>(PGOOpt) : None);
Index: lib/CodeGen/BackendUtil.cpp =================================================================== --- lib/CodeGen/BackendUtil.cpp +++ lib/CodeGen/BackendUtil.cpp @@ -855,10 +855,13 @@ if (!CodeGenOpts.SampleProfileFile.empty()) PGOOpt.SampleProfileFile = CodeGenOpts.SampleProfileFile; + if (CodeGenOpts.DebugInfoForProfiling) + PGOOpt.SampleProfileGen = true; + // Only pass a PGO options struct if -fprofile-generate or // -fprofile-use were passed on the cmdline. PassBuilder PB(TM.get(), - (PGOOpt.RunProfileGen || + (PGOOpt.RunProfileGen || PGOOpt.SampleProfileGen || !PGOOpt.ProfileUseFile.empty() || !PGOOpt.SampleProfileFile.empty()) ? Optional<PGOOptions>(PGOOpt) : None);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits