mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-03 08:55:51 +00:00
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
This commit is contained in:
parent
9c94042083
commit
3229c698e4
@ -54,7 +54,7 @@ namespace llvm {
|
|||||||
/// be abstractly described.
|
/// be abstractly described.
|
||||||
class GCStrategy {
|
class GCStrategy {
|
||||||
public:
|
public:
|
||||||
typedef std::vector<GCFunctionInfo*> list_type;
|
typedef std::vector<std::unique_ptr<GCFunctionInfo>> list_type;
|
||||||
typedef list_type::iterator iterator;
|
typedef list_type::iterator iterator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -77,7 +77,7 @@ namespace llvm {
|
|||||||
public:
|
public:
|
||||||
GCStrategy();
|
GCStrategy();
|
||||||
|
|
||||||
virtual ~GCStrategy();
|
virtual ~GCStrategy() {}
|
||||||
|
|
||||||
|
|
||||||
/// getName - The name of the GC strategy, for debugging.
|
/// getName - The name of the GC strategy, for debugging.
|
||||||
|
@ -101,13 +101,6 @@ GCStrategy::GCStrategy() :
|
|||||||
UsesMetadata(false)
|
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::initializeCustomLowering(Module &M) { return false; }
|
||||||
|
|
||||||
bool GCStrategy::performCustomLowering(Function &F) {
|
bool GCStrategy::performCustomLowering(Function &F) {
|
||||||
@ -123,9 +116,8 @@ bool GCStrategy::findCustomSafePoints(GCFunctionInfo& FI, MachineFunction &F) {
|
|||||||
|
|
||||||
|
|
||||||
GCFunctionInfo *GCStrategy::insertFunctionInfo(const Function &F) {
|
GCFunctionInfo *GCStrategy::insertFunctionInfo(const Function &F) {
|
||||||
GCFunctionInfo *FI = new GCFunctionInfo(F, *this);
|
Functions.push_back(make_unique<GCFunctionInfo>(F, *this));
|
||||||
Functions.push_back(FI);
|
return Functions.back().get();
|
||||||
return FI;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user