Replace uses of the deprecated std::auto_ptr with OwningPtr.

This is a rework of the broken parts in r179373 which were subsequently reverted in r179374 due to incompatibility with C++98 compilers.  This version should be ok under C++98.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179520 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andy Gibbs
2013-04-15 12:06:32 +00:00
parent eaa752f5e1
commit 604b3573f9
3 changed files with 38 additions and 44 deletions

View File

@@ -29,6 +29,7 @@ namespace llvm {
class MachineFunction;
class MachineLoopInfo;
class TargetRegisterInfo;
template<class T> class OwningPtr;
/// This class wraps up a PBQP instance representing a register allocation
/// problem, plus the structures necessary to map back from the PBQP solution
@@ -123,11 +124,9 @@ namespace llvm {
/// Build a PBQP instance to represent the register allocation problem for
/// the given MachineFunction.
virtual std::auto_ptr<PBQPRAProblem> build(
MachineFunction *mf,
const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
virtual PBQPRAProblem *build(MachineFunction *mf, const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
private:
void addSpillCosts(PBQP::Vector &costVec, PBQP::PBQPNum spillCost);
@@ -144,11 +143,9 @@ namespace llvm {
/// Build a PBQP instance to represent the register allocation problem for
/// the given MachineFunction.
virtual std::auto_ptr<PBQPRAProblem> build(
MachineFunction *mf,
const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
virtual PBQPRAProblem *build(MachineFunction *mf, const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
private:
@@ -161,7 +158,7 @@ namespace llvm {
PBQP::PBQPNum benefit);
};
FunctionPass* createPBQPRegisterAllocator(std::auto_ptr<PBQPBuilder> builder,
FunctionPass* createPBQPRegisterAllocator(OwningPtr<PBQPBuilder> &builder,
char *customPassID=0);
}