llvm.org GIT mirror llvm / 60e681a
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 David Blaikie 5 years ago
2 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
157157 };
158158
159159 FunctionPass *
160 createPBQPRegisterAllocator(std::unique_ptr &builder,
160 createPBQPRegisterAllocator(std::unique_ptr builder,
161161 char *customPassID = nullptr);
162162 }
163163
8787 static char ID;
8888
8989 /// Construct a PBQP register allocator.
90 RegAllocPBQP(std::unique_ptr &b, char *cPassID=nullptr)
91 : MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) {
90 RegAllocPBQP(std::unique_ptr b, char *cPassID = nullptr)
91 : MachineFunctionPass(ID), builder(std::move(b)), customPassID(cPassID) {
9292 initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
9393 initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
9494 initializeLiveStacksPass(*PassRegistry::getPassRegistry());
613613 }
614614
615615 FunctionPass *
616 llvm::createPBQPRegisterAllocator(std::unique_ptr &builder,
616 llvm::createPBQPRegisterAllocator(std::unique_ptr builder,
617617 char *customPassID) {
618 return new RegAllocPBQP(builder, customPassID);
618 return new RegAllocPBQP(std::move(builder), customPassID);
619619 }
620620
621621 FunctionPass* llvm::createDefaultPBQPRegisterAllocator() {
622622 std::unique_ptr Builder;
623623 if (pbqpCoalescing)
624 Builder.reset(new PBQPBuilderWithCoalescing());
624 Builder = llvm::make_unique();
625625 else
626 Builder.reset(new PBQPBuilder());
627 return createPBQPRegisterAllocator(Builder);
626 Builder = llvm::make_unique();
627 return createPBQPRegisterAllocator(std::move(Builder));
628628 }
629629
630630 #undef DEBUG_TYPE