diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 4193f0a..0388c67 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -80,7 +80,8 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext) Builder(cgm, cgm.getModule().getContext(), llvm::ConstantFolder(), CGBuilderInserterTy(this)), SanOpts(CGM.getLangOpts().Sanitize), CurFPFeatures(CGM.getLangOpts()), - DebugInfo(CGM.getModuleDebugInfo()), PGO(cgm), + DebugInfo(CGM.getModuleDebugInfo()), + PGO(std::make_unique<CodeGenPGO>(cgm)), ShouldEmitLifetimeMarkers( shouldEmitLifetimeMarkers(CGM.getCodeGenOpts(), CGM.getLangOpts())) { if (!suppressNewContext) @@ -1564,7 +1565,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, CurFn->addFnAttr(llvm::Attribute::MustProgress); // Generate the body of the function. - PGO.assignRegionCounters(GD, CurFn); + PGO->assignRegionCounters(GD, CurFn); if (isa<CXXDestructorDecl>(FD)) EmitDestructorBody(Args); else if (isa<CXXConstructorDecl>(FD)) @@ -1650,7 +1651,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, // Emit the standard function epilogue. FinishFunction(BodyRange.getEnd()); - PGO.verifyCounterMap(); + PGO->verifyCounterMap(); // If we haven't marked the function nothrow through other means, do // a quick pass now to see if we can. @@ -1774,7 +1775,7 @@ bool CodeGenFunction::ConstantFoldsToSimpleInteger(const Expr *Cond, if (!AllowLabels && CodeGenFunction::ContainsLabel(Cond)) return false; // Contains a label. - PGO.markStmtMaybeUsed(Cond); + PGO->markStmtMaybeUsed(Cond); ResultInt = Int; return true; } @@ -3355,4 +3356,4 @@ void CodeGenFunction::addInstToNewSourceAtom(llvm::Instruction *KeyInstruction, ApplyAtomGroup Grp(getDebugInfo()); DI->addInstToCurrentSourceAtom(KeyInstruction, Backup); } -}
\ No newline at end of file +} |