[LLVMdev] How do I free the metadata?

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Mon Feb 21 15:38:04 PST 2011


> Types, constants, and metadata are all associated with the
> LLVMContext; the primary reason for this is that it maintains pointer
> equality across modules, which is nice for cross-module work like
> linking.
> 
> It's worth noting there isn't any strong reason to reuse an
> LLVMContext for multiple modules if you're not using the module linker
> or something like it.  The LLVMContext design was introduced primarily
> to allow multi-threading, but it can also be used for memory
> management.

I could try that, but using the plugin in nm and ar is a degenerate
case. Once that works the build will get to the linker...

Shouldn't we at least free the metadata when no module is using it? The
metadata in a debug build is a lot larger than the IL itself...

> -Eli

Cheers,
Rafael



More information about the llvm-dev mailing list