mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Sure up ownership passing of the PBQPBuilder by passing unique_ptrs by value rather than lvalue reference.
Also removes an unnecessary '.release()' that should've been a std::move anyway. (I'm on a hunt for '.release()' calls) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac1b5f177b
commit
60e681a4b5
@ -158,7 +158,7 @@ namespace llvm {
|
|||||||
};
|
};
|
||||||
|
|
||||||
FunctionPass *
|
FunctionPass *
|
||||||
createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
|
createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> builder,
|
||||||
char *customPassID = nullptr);
|
char *customPassID = nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ public:
|
|||||||
static char ID;
|
static char ID;
|
||||||
|
|
||||||
/// Construct a PBQP register allocator.
|
/// Construct a PBQP register allocator.
|
||||||
RegAllocPBQP(std::unique_ptr<PBQPBuilder> &b, char *cPassID=nullptr)
|
RegAllocPBQP(std::unique_ptr<PBQPBuilder> b, char *cPassID = nullptr)
|
||||||
: MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) {
|
: MachineFunctionPass(ID), builder(std::move(b)), customPassID(cPassID) {
|
||||||
initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
|
initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
|
||||||
initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
|
initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
|
||||||
initializeLiveStacksPass(*PassRegistry::getPassRegistry());
|
initializeLiveStacksPass(*PassRegistry::getPassRegistry());
|
||||||
@ -614,18 +614,18 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FunctionPass *
|
FunctionPass *
|
||||||
llvm::createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
|
llvm::createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> builder,
|
||||||
char *customPassID) {
|
char *customPassID) {
|
||||||
return new RegAllocPBQP(builder, customPassID);
|
return new RegAllocPBQP(std::move(builder), customPassID);
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionPass* llvm::createDefaultPBQPRegisterAllocator() {
|
FunctionPass* llvm::createDefaultPBQPRegisterAllocator() {
|
||||||
std::unique_ptr<PBQPBuilder> Builder;
|
std::unique_ptr<PBQPBuilder> Builder;
|
||||||
if (pbqpCoalescing)
|
if (pbqpCoalescing)
|
||||||
Builder.reset(new PBQPBuilderWithCoalescing());
|
Builder = llvm::make_unique<PBQPBuilderWithCoalescing>();
|
||||||
else
|
else
|
||||||
Builder.reset(new PBQPBuilder());
|
Builder = llvm::make_unique<PBQPBuilder>();
|
||||||
return createPBQPRegisterAllocator(Builder);
|
return createPBQPRegisterAllocator(std::move(Builder));
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef DEBUG_TYPE
|
#undef DEBUG_TYPE
|
||||||
|
Loading…
Reference in New Issue
Block a user