mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +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 *
|
||||
createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
|
||||
createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> builder,
|
||||
char *customPassID = nullptr);
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ public:
|
||||
static char ID;
|
||||
|
||||
/// Construct a PBQP register allocator.
|
||||
RegAllocPBQP(std::unique_ptr<PBQPBuilder> &b, char *cPassID=nullptr)
|
||||
: MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) {
|
||||
RegAllocPBQP(std::unique_ptr<PBQPBuilder> b, char *cPassID = nullptr)
|
||||
: MachineFunctionPass(ID), builder(std::move(b)), customPassID(cPassID) {
|
||||
initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
|
||||
initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
|
||||
initializeLiveStacksPass(*PassRegistry::getPassRegistry());
|
||||
@ -614,18 +614,18 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) {
|
||||
}
|
||||
|
||||
FunctionPass *
|
||||
llvm::createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
|
||||
llvm::createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> builder,
|
||||
char *customPassID) {
|
||||
return new RegAllocPBQP(builder, customPassID);
|
||||
return new RegAllocPBQP(std::move(builder), customPassID);
|
||||
}
|
||||
|
||||
FunctionPass* llvm::createDefaultPBQPRegisterAllocator() {
|
||||
std::unique_ptr<PBQPBuilder> Builder;
|
||||
if (pbqpCoalescing)
|
||||
Builder.reset(new PBQPBuilderWithCoalescing());
|
||||
Builder = llvm::make_unique<PBQPBuilderWithCoalescing>();
|
||||
else
|
||||
Builder.reset(new PBQPBuilder());
|
||||
return createPBQPRegisterAllocator(Builder);
|
||||
Builder = llvm::make_unique<PBQPBuilder>();
|
||||
return createPBQPRegisterAllocator(std::move(Builder));
|
||||
}
|
||||
|
||||
#undef DEBUG_TYPE
|
||||
|
Loading…
Reference in New Issue
Block a user