summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenPGO.h
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-12-02 22:38:52 +0000
committerJustin Bogner <mail@justinbogner.com>2014-12-02 22:38:52 +0000
commit7f8cf5bff7c8a87a878f684fe50a739929a416de (patch)
tree1e7e17611610bfb4d5ac874a1a1d53b3b523746f /clang/lib/CodeGen/CodeGenPGO.h
parent6b988ad8f2285e8bb3c56db38c0416f6186d3889 (diff)
downloadbcm5719-llvm-7f8cf5bff7c8a87a878f684fe50a739929a416de.tar.gz
bcm5719-llvm-7f8cf5bff7c8a87a878f684fe50a739929a416de.zip
InstrProf: Remove some pointless indirection (NFC)
It doesn't make much sense to have std::unique_ptrs of std::string and std::vector. Avoid some useless indirection by using these types directly. llvm-svn: 223166
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