Displaying 3 results from an estimated 3 matches for "writearray".
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
...to create a GlobalVariable that is a ConstantArray. Id like
each element to be a pointer to other things in the program(global
variables, functions). So that they all have the same type 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<C...
2011 Nov 15
0
[LLVMdev] constructing global array of pointers?
...or function). The follow code makes
sense to me and compiles fine, but gives me the wrong output. When I
look at the section in the ELF file it is larger than I expected 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...
2011 Nov 24
0
[LLVMdev] differences in IR and ELF?
...is a ConstantArray. Id like
> each element to be a pointer to other things in the program(global
> variables, functions). So that they all have the same type 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());
>
> Const...