X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FRegAllocPBQP.cpp;h=96dbd9a1010e549a6d42a2f1bf20de4bddbf7d41;hb=3bfc4d8e13edd83534b733f0f1de5b1d5f6bf828;hp=c9588db738ce21c9edd4ac351f62d437994f8ba5;hpb=1a6eca243f9274b9b371b7306fa939568ce5c37f;p=oota-llvm.git diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp index c9588db738c..96dbd9a1010 100644 --- a/lib/CodeGen/RegAllocPBQP.cpp +++ b/lib/CodeGen/RegAllocPBQP.cpp @@ -34,7 +34,6 @@ #include "llvm/CodeGen/RegAllocPBQP.h" #include "RegisterCoalescer.h" #include "Spiller.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/CodeGen/CalcSpillWeights.h" #include "llvm/CodeGen/LiveIntervalAnalysis.h" @@ -88,7 +87,7 @@ public: static char ID; /// Construct a PBQP register allocator. - RegAllocPBQP(OwningPtr &b, char *cPassID=0) + RegAllocPBQP(std::unique_ptr &b, char *cPassID=0) : MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) { initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); @@ -97,15 +96,15 @@ public: } /// Return the pass name. - virtual const char* getPassName() const { + const char* getPassName() const override { return "PBQP Register Allocator"; } /// PBQP analysis usage. - virtual void getAnalysisUsage(AnalysisUsage &au) const; + void getAnalysisUsage(AnalysisUsage &au) const override; /// Perform register allocation - virtual bool runOnMachineFunction(MachineFunction &MF); + bool runOnMachineFunction(MachineFunction &MF) override; private: @@ -117,8 +116,7 @@ private: typedef std::map CoalesceMap; typedef std::set RegSet; - - OwningPtr builder; + std::unique_ptr builder; char *customPassID; @@ -129,7 +127,7 @@ private: MachineRegisterInfo *mri; const MachineBlockFrequencyInfo *mbfi; - OwningPtr spiller; + std::unique_ptr spiller; LiveIntervals *lis; LiveStacks *lss; VirtRegMap *vrm; @@ -191,7 +189,7 @@ PBQPRAProblem *PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis, MachineRegisterInfo *mri = &mf->getRegInfo(); const TargetRegisterInfo *tri = mf->getTarget().getRegisterInfo(); - OwningPtr p(new PBQPRAProblem()); + std::unique_ptr p(new PBQPRAProblem()); PBQPRAGraph &g = p->getGraph(); RegSet pregs; @@ -314,7 +312,7 @@ PBQPRAProblem *PBQPBuilderWithCoalescing::build(MachineFunction *mf, const MachineBlockFrequencyInfo *mbfi, const RegSet &vregs) { - OwningPtr p(PBQPBuilder::build(mf, lis, mbfi, vregs)); + std::unique_ptr p(PBQPBuilder::build(mf, lis, mbfi, vregs)); PBQPRAGraph &g = p->getGraph(); const TargetMachine &tm = mf->getTarget(); @@ -587,8 +585,8 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { while (!pbqpAllocComplete) { DEBUG(dbgs() << " PBQP Regalloc round " << round << ":\n"); - OwningPtr problem( - builder->build(mf, lis, mbfi, vregsToAlloc)); + std::unique_ptr problem( + builder->build(mf, lis, mbfi, vregsToAlloc)); #ifndef NDEBUG if (pbqpDumpGraphs) { @@ -622,14 +620,14 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { return true; } -FunctionPass* llvm::createPBQPRegisterAllocator( - OwningPtr &builder, - char *customPassID) { +FunctionPass * +llvm::createPBQPRegisterAllocator(std::unique_ptr &builder, + char *customPassID) { return new RegAllocPBQP(builder, customPassID); } FunctionPass* llvm::createDefaultPBQPRegisterAllocator() { - OwningPtr Builder; + std::unique_ptr Builder; if (pbqpCoalescing) Builder.reset(new PBQPBuilderWithCoalescing()); else