From 200241e4de11981523b3d14f3acab6129efed701 Mon Sep 17 00:00:00 2001 From: Andy Gibbs Date: Fri, 12 Apr 2013 10:56:28 +0000 Subject: Replace uses of the deprecated std::auto_ptr with OwningPtr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179373 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAllocPBQP.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/CodeGen/RegAllocPBQP.cpp') diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp index 607edac24b..42cdc649c2 100644 --- a/lib/CodeGen/RegAllocPBQP.cpp +++ b/lib/CodeGen/RegAllocPBQP.cpp @@ -89,8 +89,8 @@ public: static char ID; /// Construct a PBQP register allocator. - RegAllocPBQP(std::auto_ptr b, char *cPassID=0) - : MachineFunctionPass(ID), builder(b), customPassID(cPassID) { + RegAllocPBQP(OwningPtr b, char *cPassID=0) + : MachineFunctionPass(ID), builder(b.take()), customPassID(cPassID) { initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); initializeCalculateSpillWeightsPass(*PassRegistry::getPassRegistry()); @@ -121,7 +121,7 @@ private: typedef std::set RegSet; - std::auto_ptr builder; + OwningPtr builder; char *customPassID; @@ -132,7 +132,7 @@ private: const MachineLoopInfo *loopInfo; MachineRegisterInfo *mri; - std::auto_ptr spiller; + OwningPtr spiller; LiveIntervals *lis; LiveStacks *lss; VirtRegMap *vrm; @@ -186,16 +186,16 @@ unsigned PBQPRAProblem::getPRegForOption(unsigned vreg, unsigned option) const { return allowedSet[option - 1]; } -std::auto_ptr PBQPBuilder::build(MachineFunction *mf, - const LiveIntervals *lis, - const MachineLoopInfo *loopInfo, - const RegSet &vregs) { +OwningPtr PBQPBuilder::build(MachineFunction *mf, + const LiveIntervals *lis, + const MachineLoopInfo *loopInfo, + const RegSet &vregs) { LiveIntervals *LIS = const_cast(lis); MachineRegisterInfo *mri = &mf->getRegInfo(); const TargetRegisterInfo *tri = mf->getTarget().getRegisterInfo(); - std::auto_ptr p(new PBQPRAProblem()); + OwningPtr p(new PBQPRAProblem()); PBQP::Graph &g = p->getGraph(); RegSet pregs; @@ -311,13 +311,13 @@ void PBQPBuilder::addInterferenceCosts( } } -std::auto_ptr PBQPBuilderWithCoalescing::build( +OwningPtr PBQPBuilderWithCoalescing::build( MachineFunction *mf, const LiveIntervals *lis, const MachineLoopInfo *loopInfo, const RegSet &vregs) { - std::auto_ptr p = PBQPBuilder::build(mf, lis, loopInfo, vregs); + OwningPtr p = PBQPBuilder::build(mf, lis, loopInfo, vregs); PBQP::Graph &g = p->getGraph(); const TargetMachine &tm = mf->getTarget(); @@ -584,7 +584,7 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { while (!pbqpAllocComplete) { DEBUG(dbgs() << " PBQP Regalloc round " << round << ":\n"); - std::auto_ptr problem = + OwningPtr problem = builder->build(mf, lis, loopInfo, vregsToAlloc); #ifndef NDEBUG @@ -621,18 +621,18 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { } FunctionPass* llvm::createPBQPRegisterAllocator( - std::auto_ptr builder, + OwningPtr builder, char *customPassID) { - return new RegAllocPBQP(builder, customPassID); + return new RegAllocPBQP(OwningPtr(builder.take()), customPassID); } FunctionPass* llvm::createDefaultPBQPRegisterAllocator() { if (pbqpCoalescing) { return createPBQPRegisterAllocator( - std::auto_ptr(new PBQPBuilderWithCoalescing())); + OwningPtr(new PBQPBuilderWithCoalescing())); } // else return createPBQPRegisterAllocator( - std::auto_ptr(new PBQPBuilder())); + OwningPtr(new PBQPBuilder())); } #undef DEBUG_TYPE -- cgit v1.2.3