<div dir="ltr">Probably no because I think MipsReginfo is trivially destructible. But with the new code you don't have to even think about it.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 7:44 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This was showing as a leak in the asan bot?<br>
<br>
Cheers,<br>
Rafael<br>
<br>
<br>
On 5 April 2016 at 22:52, Rui Ueyama via llvm-commits<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: ruiu<br>
> Date: Tue Apr 5 21:52:47 2016<br>
> New Revision: 265512<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=265512&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=265512&view=rev</a><br>
> Log:<br>
> Do not allocate MipsReginfo using BumpPtrAllocator.<br>
><br>
> So that MipsReginfo's destructor will be called.<br>
><br>
> Modified:<br>
> lld/trunk/ELF/InputFiles.cpp<br>
> lld/trunk/ELF/InputFiles.h<br>
><br>
> Modified: lld/trunk/ELF/InputFiles.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=265512&r1=265511&r2=265512&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=265512&r1=265511&r2=265512&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/ELF/InputFiles.cpp (original)<br>
> +++ lld/trunk/ELF/InputFiles.cpp Tue Apr 5 21:52:47 2016<br>
> @@ -268,8 +268,8 @@ elf::ObjectFile<ELFT>::createInputSectio<br>
> // A MIPS object file has a special section that contains register<br>
> // usage info, which needs to be handled by the linker specially.<br>
> if (Config->EMachine == EM_MIPS && Name == ".reginfo") {<br>
> - MipsReginfo = new (Alloc) MipsReginfoInputSection<ELFT>(this, &Sec);<br>
> - return MipsReginfo;<br>
> + MipsReginfo.reset(new MipsReginfoInputSection<ELFT>(this, &Sec));<br>
> + return MipsReginfo.get();<br>
> }<br>
><br>
> // We dont need special handling of .eh_frame sections if relocatable<br>
><br>
> Modified: lld/trunk/ELF/InputFiles.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=265512&r1=265511&r2=265512&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=265512&r1=265511&r2=265512&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/ELF/InputFiles.h (original)<br>
> +++ lld/trunk/ELF/InputFiles.h Tue Apr 5 21:52:47 2016<br>
> @@ -146,7 +146,7 @@ private:<br>
> std::vector<SymbolBody *> SymbolBodies;<br>
><br>
> // MIPS .reginfo section defined by this file.<br>
> - MipsReginfoInputSection<ELFT> *MipsReginfo = nullptr;<br>
> + std::unique_ptr<MipsReginfoInputSection<ELFT>> MipsReginfo;<br>
><br>
> llvm::BumpPtrAllocator Alloc;<br>
> llvm::SpecificBumpPtrAllocator<InputSection<ELFT>> IAlloc;<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>