summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.h')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h
index fd1418fb3a9..3a2deae31da 100644
--- a/clang/lib/CodeGen/CodeGenPGO.h
+++ b/clang/lib/CodeGen/CodeGenPGO.h
@@ -31,7 +31,7 @@ class RegionCounter;
class CodeGenPGO {
private:
CodeGenModule &CGM;
- std::unique_ptr<std::string> PrefixedFuncName;
+ std::string PrefixedFuncName;
StringRef RawFuncName;
llvm::GlobalValue::LinkageTypes VarLinkage;
@@ -40,7 +40,7 @@ private:
llvm::GlobalVariable *RegionCounters;
std::unique_ptr<llvm::DenseMap<const Stmt *, unsigned>> RegionCounterMap;
std::unique_ptr<llvm::DenseMap<const Stmt *, uint64_t>> StmtCountMap;
- std::unique_ptr<std::vector<uint64_t>> RegionCounts;
+ std::vector<uint64_t> RegionCounts;
uint64_t CurrentRegionCount;
std::string CoverageMapping;
/// \brief A flag that is set to true when this function doesn't need
@@ -56,11 +56,11 @@ public:
/// Whether or not we have PGO region data for the current function. This is
/// false both when we have no data at all and when our data has been
/// discarded.
- bool haveRegionCounts() const { return RegionCounts != nullptr; }
+ bool haveRegionCounts() const { return !RegionCounts.empty(); }
/// Get the string used to identify this function in the profile data.
/// For functions with local linkage, this includes the main file name.
- StringRef getFuncName() const { return StringRef(*PrefixedFuncName); }
+ StringRef getFuncName() const { return StringRef(PrefixedFuncName); }
std::string getFuncVarName(StringRef VarName) const {
return ("__llvm_profile_" + VarName + "_" + RawFuncName).str();
}
@@ -151,7 +151,7 @@ private:
uint64_t getRegionCount(unsigned Counter) {
if (!haveRegionCounts())
return 0;
- return (*RegionCounts)[Counter];
+ return RegionCounts[Counter];
}
friend class RegionCounter;
OpenPOWER on IntegriCloud