[LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?

Paul Vario paul.paul.mit at gmail.com
Mon Feb 17 17:29:46 PST 2014


Hi Fellows,

        Is there a way to allocate dynamic array within an LLVM IR file
from my code generator? Say., how to create an array type with a size
determined through a global variable. Symbolically, something like below:

                    Value *sz = Mod->getOrInsertGlobal("SIZE", Int32Ty);
                    Type *ArrayTy = ArrayType::get(FloatTy, sz)
                    AllocaInst *AI = CreateAlloca(ArrayTy, 0, "");


Thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140217/249b89be/attachment.html>


More information about the llvm-dev mailing list