diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 1073de1d25ec..226950ab599e 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1652,7 +1652,8 @@ private: uint64_t LoopCount) const; public: - std::pair getIsCounterPair(const Stmt *S) const; + bool hasSkipCounter(const Stmt *S) const; + void markStmtAsUsed(bool Skipped, const Stmt *S); void markStmtMaybeUsed(const Stmt *S); diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 30004fd93e93..b4de643d90a7 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -1187,15 +1187,15 @@ CodeGenPGO::applyFunctionAttributes(llvm::IndexedInstrProfReader *PGOReader, Fn->setEntryCount(FunctionCount); } -std::pair CodeGenPGO::getIsCounterPair(const Stmt *S) const { +bool CodeGenPGO::hasSkipCounter(const Stmt *S) const { if (!RegionCounterMap) - return {false, false}; + return false; auto I = RegionCounterMap->find(S); if (I == RegionCounterMap->end()) - return {false, false}; + return false; - return {I->second.Executed.hasValue(), I->second.Skipped.hasValue()}; + return I->second.Skipped.hasValue(); } void CodeGenPGO::emitCounterSetOrIncrement(CGBuilderTy &Builder, const Stmt *S, @@ -1567,8 +1567,8 @@ void CodeGenFunction::incrementProfileCounter(CounterForIncrement ExecSkip, PGO->setCurrentStmt(S); } -std::pair CodeGenFunction::getIsCounterPair(const Stmt *S) const { - return PGO->getIsCounterPair(S); +bool CodeGenFunction::hasSkipCounter(const Stmt *S) const { + return PGO->hasSkipCounter(S); } void CodeGenFunction::markStmtAsUsed(bool Skipped, const Stmt *S) { PGO->markStmtAsUsed(Skipped, S); diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h index 5e2d72e8427f..e44574b5d209 100644 --- a/clang/lib/CodeGen/CodeGenPGO.h +++ b/clang/lib/CodeGen/CodeGenPGO.h @@ -110,7 +110,7 @@ private: bool canEmitMCDCCoverage(const CGBuilderTy &Builder); public: - std::pair getIsCounterPair(const Stmt *S) const; + bool hasSkipCounter(const Stmt *S) const; bool isMCDCDecisionExpr(const Expr *E) const { if (!RegionMCDCState)