[LLVMdev] common type at compile time?

ret val retval386 at gmail.com
Thu Oct 20 08:43:01 PDT 2011


I'm trying to create a ConstantArray(whose contents will be of types
Function*, GlobalVariable *) so I can immediately create a new
GlobalVariable(that will be in its own section). I'm doing this so I
have these address stored. In order to create this ConstantArray I
need a valid ArrayType, but I'm not sure what to use for the element
type.

I want this to be done at compile time, so I cant use a BitCastInst to
make them all generic pointers. What else can I do?

In other words
* I built up a vector id like to eventually store as a GlobalVariable
array: vector<Constant *> v_elements;
* Turned it into something for the ConstantArray::get can use:
ArrayRef<Constant *> a_elements(v_elements);
* And now I need to come up with the ArrayType arg for the
ConstantArray::get() method where I only know: ArrayType::get(???, 4);

Thanks



More information about the llvm-dev mailing list