summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-09-02 17:42:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-09-02 17:42:01 +0000
commit505e1b829fd181a12ffc4b62f00cbe8d61c92c2c (patch)
tree593e0e2bc47dc90abdecc58e8751ecb31fb225da /llvm/lib/CodeGen
parent9ca4870b495830b7aff87916119536eb0c056006 (diff)
downloadbcm5719-llvm-505e1b829fd181a12ffc4b62f00cbe8d61c92c2c.tar.gz
bcm5719-llvm-505e1b829fd181a12ffc4b62f00cbe8d61c92c2c.zip
unique_ptrify PBQPBuilder::build
llvm-svn: 216918
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocPBQP.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp
index 7475f73308f..23043a222e2 100644
--- a/llvm/lib/CodeGen/RegAllocPBQP.cpp
+++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp
@@ -183,15 +183,15 @@ unsigned PBQPRAProblem::getPRegForOption(unsigned vreg, unsigned option) const {
return allowedSet[option - 1];
}
-PBQPRAProblem *PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis,
- const MachineBlockFrequencyInfo *mbfi,
- const RegSet &vregs) {
+std::unique_ptr<PBQPRAProblem>
+PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis,
+ const MachineBlockFrequencyInfo *mbfi, const RegSet &vregs) {
LiveIntervals *LIS = const_cast<LiveIntervals*>(lis);
MachineRegisterInfo *mri = &mf->getRegInfo();
const TargetRegisterInfo *tri = mf->getSubtarget().getRegisterInfo();
- std::unique_ptr<PBQPRAProblem> p(new PBQPRAProblem());
+ auto p = llvm::make_unique<PBQPRAProblem>();
PBQPRAGraph &g = p->getGraph();
RegSet pregs;
@@ -280,7 +280,7 @@ PBQPRAProblem *PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis,
}
}
- return p.release();
+ return p;
}
void PBQPBuilder::addSpillCosts(PBQP::Vector &costVec,
@@ -309,12 +309,12 @@ void PBQPBuilder::addInterferenceCosts(
}
}
-PBQPRAProblem *PBQPBuilderWithCoalescing::build(MachineFunction *mf,
- const LiveIntervals *lis,
- const MachineBlockFrequencyInfo *mbfi,
- const RegSet &vregs) {
+std::unique_ptr<PBQPRAProblem>
+PBQPBuilderWithCoalescing::build(MachineFunction *mf, const LiveIntervals *lis,
+ const MachineBlockFrequencyInfo *mbfi,
+ const RegSet &vregs) {
- std::unique_ptr<PBQPRAProblem> p(PBQPBuilder::build(mf, lis, mbfi, vregs));
+ std::unique_ptr<PBQPRAProblem> p = PBQPBuilder::build(mf, lis, mbfi, vregs);
PBQPRAGraph &g = p->getGraph();
const TargetMachine &tm = mf->getTarget();
@@ -383,7 +383,7 @@ PBQPRAProblem *PBQPBuilderWithCoalescing::build(MachineFunction *mf,
}
}
- return p.release();
+ return p;
}
void PBQPBuilderWithCoalescing::addPhysRegCoalesce(PBQP::Vector &costVec,
@@ -579,8 +579,8 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) {
while (!pbqpAllocComplete) {
DEBUG(dbgs() << " PBQP Regalloc round " << round << ":\n");
- std::unique_ptr<PBQPRAProblem> problem(
- builder->build(mf, lis, mbfi, vregsToAlloc));
+ std::unique_ptr<PBQPRAProblem> problem =
+ builder->build(mf, lis, mbfi, vregsToAlloc);
#ifndef NDEBUG
if (pbqpDumpGraphs) {
OpenPOWER on IntegriCloud