[LLVMdev] RFC: Constant Creation API

Maurice Gittens mainmanmauricio at gmail.com
Sat Jul 25 11:51:27 PDT 2009


On Sat, Jul 25, 2009 at 7:47 PM, Chris Lattner <clattner at apple.com> wrote:

> On Jul 25, 2009, at 5:44 AM, Maurice Gittens wrote:
>
> Assuming that I have a threaded JIT server which has an llvmContext object
> on the stack of every JITting thread in the server.
>
> When using the 2.5. API like:
>
> C = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
>
> I need to assume that there exists some global llvmContext object which
> holds
> the predefined llvm types.
>
> Does this entail that in my threaded server I need to create new types for
> llvm::Type::Int32Ty and the like,  which are associated with the
> llvm::Context on the stack?
>
>
> Yes, you'll have to write something like:
> C = llvm::ConstantInt::get(llvm::Type::getInt32Ty(Context), 0);
>


Ok, Thanks.

Kind regards,
Maurice



>
> -Chris
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090725/b068949f/attachment.html>


More information about the llvm-dev mailing list