[LLVMdev] MAJOR API CHANGE: LLVMContext
nicolas.geoffray at lip6.fr
Tue Jun 30 19:38:55 PDT 2009
That's awesome, thanks very much for working on this Owen. So if I
understand correctly, there can be as many LLVMContext instances as we
want? Or one module only has a single LLVMContext?
A similar question is: can I now delete constants created, after
JIT-compiling a function's IR? I know we can already delete the body of
the function, but not the constants the body needs. So can we do that now?
Owen Anderson wrote:
> Notice of a major upcoming API change: The static methods for
> constructing types and constants will be going away in the future.
> Instead, the global uniquing tables that lurk behind these APIs will
> be privatized within LLVMContext instances.
> What this means for you: Your client application will need to create
> an LLVMContext in main(), and pass it into a few APIs (the constructor
> for Module, for instance). You can, in theory, have more than one
> LLVMContext as long as you never want Modules created under separate
> contexts to interact.
> In the near term, I will be committing patches to do this conversion
> for the existing LLVM tools, including Clang and LLVM-GCC, which
> should provide examples for those following along at home.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev