summaryrefslogtreecommitdiff
path: root/lib/CodeGen/GCStrategy.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-15 06:07:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-15 06:07:26 +0000
commit3229c698e4c395d324814a386853d836b8d6f80c (patch)
tree3ae5daac300c28390cedd8d3621dd0914206fbff /lib/CodeGen/GCStrategy.cpp
parent9c940420835adfc7ea3066beda3b5c3c327f0332 (diff)
downloadllvm-3229c698e4c395d324814a386853d836b8d6f80c.tar.gz
llvm-3229c698e4c395d324814a386853d836b8d6f80c.tar.bz2
llvm-3229c698e4c395d324814a386853d836b8d6f80c.tar.xz
Use unique_ptr to manage ownership of GCFunctionInfos in GCStrategy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/GCStrategy.cpp')
-rw-r--r--lib/CodeGen/GCStrategy.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp
index a5fa3674a7..1fdff6bbf1 100644
--- a/lib/CodeGen/GCStrategy.cpp
+++ b/lib/CodeGen/GCStrategy.cpp
@@ -101,13 +101,6 @@ GCStrategy::GCStrategy() :
UsesMetadata(false)
{}
-GCStrategy::~GCStrategy() {
- for (iterator I = begin(), E = end(); I != E; ++I)
- delete *I;
-
- Functions.clear();
-}
-
bool GCStrategy::initializeCustomLowering(Module &M) { return false; }
bool GCStrategy::performCustomLowering(Function &F) {
@@ -123,9 +116,8 @@ bool GCStrategy::findCustomSafePoints(GCFunctionInfo& FI, MachineFunction &F) {
GCFunctionInfo *GCStrategy::insertFunctionInfo(const Function &F) {
- GCFunctionInfo *FI = new GCFunctionInfo(F, *this);
- Functions.push_back(FI);
- return FI;
+ Functions.push_back(make_unique<GCFunctionInfo>(F, *this));
+ return Functions.back().get();
}
// -----------------------------------------------------------------------------