[llvm-commits] [PATCH] Fix leaks in LLVMContext!

Török Edwin edwintorok at gmail.com
Fri Aug 28 06:24:16 PDT 2009


Now that all the ManagedStatic constants are in LLVMContext, we can
delete the constants when the LLVMContext is destroyed, and we
can control the destruction order by doing that in ~LLVMContextImpl.

Attached are 2 patches that fix leaks, it passed make check for me
(didn't check llvm-gcc yet).

The 0002-Fix-ExplicitSymbols-leak.patch is independent of the
LLVMContext leak fixes.
It deletes the ExplicitSymbols map, for some reason valgrind reports the
std::string created in AddSymbol as possibly lost
instead of still reachable.

The 0001- leakfixes are not LLVM 2.6, because I had to fix several tools
(llvm-nm, bugpoint) to delete the Module, otherwise
an assertion would fail on shutdown (Use still stuck after Def: ret i32 2).

I'd like to apply this patch to trunk, thoughts?

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Leakfix.patch
Type: text/x-diff
Size: 6804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090828/03b5a064/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-ExplicitSymbols-leak.patch
Type: text/x-diff
Size: 976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090828/03b5a064/attachment-0001.patch>

More information about the llvm-commits mailing list