[Profile] Use a flag to enable PGO rather than the profraw filename

Patch by Jake VanAdrighem

Differential Revision: http://reviews.llvm.org/D22608

llvm-svn: 276517
This commit is contained in:
Xinliang David Li 2016-07-23 04:28:59 +00:00
parent 9239245401
commit b65f8ae9e8
1 changed files with 1 additions and 0 deletions

View File

@ -453,6 +453,7 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
MPM.add(createInstrProfilingLegacyPass(Options));
}
if (CodeGenOpts.hasProfileIRInstr()) {
PMBuilder.EnablePGOInstrGen = true;
if (!CodeGenOpts.InstrProfileOutput.empty())
PMBuilder.PGOInstrGen = CodeGenOpts.InstrProfileOutput;
else