[LLVMdev] LLVM and memory leaks

Morten Ofstad morten at hue.no
Wed Nov 10 08:41:55 PST 2004


Hi,

I fixed my initial problem with the order of static destructors, so the 
program no longer crashes on shutdown. However I'm getting a lot of 
warnings about memory leaks -- it seems the LLVM type factories are 
creating objects in their 'get' method which are never deleted. This is 
unacceptable because these warnings make it very hard to track if any 
other memory is leaking from the application. I tried deleting these 
types but ran into problems with the ContainedTys referencing types 
which have already been deleted causing the application to crash when 
calling the destructor.

It seems that to delete the types properly on program exit the reference 
counting has to be enabled also for types which are not abstract -- is 
this possible?

m.





More information about the llvm-dev mailing list