Free memory allocated by LLVM

I am trying a bit to find how to free the memory allocated by LLVM functions. For example, when I call a function Function::Create()to create an LLVM function, how can I free the allocated memory? The same applies to many LLVM functions, such as IRBuilder::CreateAlloca(), IRBuilder::CreateStore()etc. Any idea?

+3
source share
1 answer

First of all, when deleting any, Valuemake sure that it does not User. Removing the values ​​used will obviously lead to errors (in the statement form). This can be easily verified by calling getNumUses()or better (read: faster) hasNUses(0).

, , . :

+3

All Articles