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.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h
index 2645537cba6..c59a58e3f89 100644
--- a/clang/lib/CodeGen/CodeGenPGO.h
+++ b/clang/lib/CodeGen/CodeGenPGO.h
@@ -53,26 +53,22 @@ public:
class CodeGenPGO {
private:
CodeGenModule &CGM;
- std::string *PrefixedFuncName;
+ std::unique_ptr<std::string> PrefixedFuncName;
StringRef RawFuncName;
llvm::GlobalValue::LinkageTypes VarLinkage;
unsigned NumRegionCounters;
uint64_t FunctionHash;
llvm::GlobalVariable *RegionCounters;
- llvm::DenseMap<const Stmt*, unsigned> *RegionCounterMap;
- llvm::DenseMap<const Stmt*, uint64_t> *StmtCountMap;
- std::vector<uint64_t> *RegionCounts;
+ 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;
uint64_t CurrentRegionCount;
public:
CodeGenPGO(CodeGenModule &CGM)
- : CGM(CGM), PrefixedFuncName(0), NumRegionCounters(0), FunctionHash(0),
- RegionCounters(0), RegionCounterMap(0), StmtCountMap(0),
- RegionCounts(0), CurrentRegionCount(0) {}
- ~CodeGenPGO() {
- if (PrefixedFuncName) delete PrefixedFuncName;
- }
+ : CGM(CGM), NumRegionCounters(0), FunctionHash(0), RegionCounters(0),
+ CurrentRegionCount(0) {}
/// 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
OpenPOWER on IntegriCloud