diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-12-02 22:38:52 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-12-02 22:38:52 +0000 |
commit | b1d3eaf79f02867e1bb8b44abd05023176ef6e2a (patch) | |
tree | 7539e3f97281c6cd1159bb212a56a0266f6f037b /lib/CodeGen/CodeGenPGO.h | |
parent | 878c801ddc96d3f77177aba7918428fc64adad24 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenPGO.h')
-rw-r--r-- | lib/CodeGen/CodeGenPGO.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenPGO.h b/lib/CodeGen/CodeGenPGO.h index fd1418fb3a..3a2deae31d 100644 --- a/lib/CodeGen/CodeGenPGO.h +++ b/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; |