[LLVMdev] How to implement list in llvm

B B blackbox.dev.ml at gmail.com
Mon Apr 15 03:13:10 PDT 2013


Hi!
I want to implement a list (which operates like ArrayList in Java).

I can use ArrayType from llvm, but at creation time I have to specify
size so there is a problem when I want to extend it (I can reallocate
it ofc). Moreover I need to implement all the operations (inserting,
removing etc.) manually.

I though that maybe I can use std::vector, but there is another
problem - std::vector is a template class, so I have to specify type
before compiling it to llvm bytecode. Is there some solution to
specify that type dynamically?

What is the best method to implement such things in llvm?

I would be grateful for any solutions or tips.



More information about the llvm-dev mailing list