Displaying 7 results from an estimated 7 matches for "v_elements".
Did you mean:
n_elements
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
...pe Id like to
make the elements void pointers.
I think I am going about this wrong, heres how I am doing it:
void writeArray(Module &M, GlobalVariable *shadow, Function *val,
Function *func) {
/* Build up contents */
vector<Constant *> v_elements;
Type *elm_type = Type::getInt32PtrTy(M.getContext());
Constant *tmp = dyn_cast<Constant>(shadow);
assert(tmp != NULL && "shadow");
v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type));
tmp...
2011 Oct 20
3
[LLVMdev] common type at compile time?
...e, 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
2011 Nov 15
0
[LLVMdev] constructing global array of pointers?
...pected and
appears to be wrong. The contents of the array do not seem to be valid
offsets.
Am I constructing it wrong?
Thank you
void writeArray(Module &M, GlobalVariable *shadow, Function *val,
Function *func) {
/* Build up contents */
vector<Constant *> v_elements;
Type *elm_type = Type::getInt32PtrTy(M.getContext());
Constant *tmp = dyn_cast<Constant>(shadow);
assert(tmp != NULL && "shadow");
v_elements.push_back(ConstantExpr::getBitCast(tmp, elm_type));...
2011 Nov 24
0
[LLVMdev] differences in IR and ELF?
...s void pointers.
>
> I think I am going about this wrong, heres how I am doing it:
>
> void writeArray(Module &M, GlobalVariable *shadow, Function *val,
> Function *func) {
> /* Build up contents */
> vector<Constant *> v_elements;
> Type *elm_type = Type::getInt32PtrTy(M.getContext());
>
> Constant *tmp = dyn_cast<Constant>(shadow);
> assert(tmp != NULL && "shadow");
> v_elements.push_back(ConstantExpr::getBitCast(tmp,
> elm_ty...
2011 Oct 20
2
[LLVMdev] common type at compile time?
...Variable objects. The ArrayType can be an array of pointers to 8-byte
> characters (basically a void pointer type).
>
> -- John T.
>
>>
>> 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);
>>
>>...
2011 Oct 20
0
[LLVMdev] common type at compile time?
...ession) for Function and
GlobalVariable objects. The ArrayType can be an array of pointers to
8-byte characters (basically a void pointer type).
-- John T.
>
> 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
> ___________...
2011 Oct 20
0
[LLVMdev] common type at compile time?
...e ArrayType can be an array of pointers to 8-byte
>> characters (basically a void pointer type).
>>
>> -- John T.
>>
>>> 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);...