[LLVMdev] MAJOR API CHANGE: LLVMContext

Owen Anderson resistor at mac.com
Tue Jun 30 17:14:03 PDT 2009


To ease this transition, I have added a getGlobalContext() API.  If  
you're only ever planning to use LLVM on a single thread, it will be  
completely safe to simply pass this value to every API that takes an  
LLVMContext.

--Owen

On Jun 30, 2009, at 3:38 PM, 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.
>
> --Owen
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list