llvm.org GIT mirror llvm / cd68cff
Change MCDisassembler::setSymbolizer to take unique_ptr by value. This changes the interface to be more explicit that ownership is being transferred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203223 91177308-0d34-0410-b5e6-96231b3b80d8 Ahmed Charles 5 years ago
4 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
113113
114114 /// Set \p Symzer as the current symbolizer.
115115 /// This takes ownership of \p Symzer, and deletes the previously set one.
116 void setSymbolizer(std::unique_ptr &Symzer);
116 void setSymbolizer(std::unique_ptr Symzer);
117117
118118 /// Sets up an external symbolizer that uses the C API callbacks.
119119 void setupForSymbolicDisassembly(LLVMOpInfoCallback GetOpInfo,
8383
8484 std::unique_ptr Symbolizer(TheTarget->createMCSymbolizer(
8585 Triple, GetOpInfo, SymbolLookUp, DisInfo, Ctx, RelInfo.release()));
86 DisAsm->setSymbolizer(Symbolizer);
86 DisAsm->setSymbolizer(std::move(Symbolizer));
8787 DisAsm->setupForSymbolicDisassembly(GetOpInfo, SymbolLookUp, DisInfo,
8888 Ctx, RelInfo);
8989 // Set up the instruction printer.
5454 Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address);
5555 }
5656
57 void MCDisassembler::setSymbolizer(std::unique_ptr &Symzer) {
58 Symbolizer.reset(Symzer.release());
57 void MCDisassembler::setSymbolizer(std::unique_ptr Symzer) {
58 Symbolizer = std::move(Symzer);
5959 }
326326 std::unique_ptr Symzer(
327327 MCObjectSymbolizer::createObjectSymbolizer(*Ctx.get(), RelInfo, Obj));
328328 if (Symzer)
329 DisAsm->setSymbolizer(Symzer);
329 DisAsm->setSymbolizer(std::move(Symzer));
330330 }
331331 }
332332