diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-04-15 06:07:26 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-04-15 06:07:26 +0000 |
commit | dc72f9774d5636b517ed9cec0a521313bdeaf9c4 (patch) | |
tree | 686613909b5a1332be18c2cf96bafdd6a82967d3 /llvm/lib | |
parent | ec528ee93f031bfb15853c8896d9a4da4d9bf6e9 (diff) | |
download | bcm5719-llvm-dc72f9774d5636b517ed9cec0a521313bdeaf9c4.tar.gz bcm5719-llvm-dc72f9774d5636b517ed9cec0a521313bdeaf9c4.zip |
Use unique_ptr to manage ownership of GCFunctionInfos in GCStrategy
llvm-svn: 206249
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/GCStrategy.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/GCStrategy.cpp b/llvm/lib/CodeGen/GCStrategy.cpp index a5fa3674a7b..1fdff6bbf10 100644 --- a/llvm/lib/CodeGen/GCStrategy.cpp +++ b/llvm/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(); } // ----------------------------------------------------------------------------- |