patch: fix memory leak of TargetMachine

Nick Lewycky nlewycky at google.com
Thu Jun 20 22:43:00 PDT 2013


Presently EmitAssemblyHelper::EmitAssembly unconditionally leaks an
llvm::TargetMachine. This is quite unhelpful when using clang as a library.
The attached patch adds a codegen option for whether we permit leaking it,
and ties that to the same -disable-free flag that the frontend uses. Please
review!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130620/a8a6592e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.patch
Type: application/octet-stream
Size: 2402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130620/a8a6592e/attachment.obj>


More information about the cfe-commits mailing list