search for: merged_ptr

Displaying 1 result from an estimated 1 matches for "merged_ptr".

2012 Oct 13
1
[LLVMdev] Accessing merged globals through PointerType
...fied): struct mergestruct { int foo[N]; int bar[N]; int baz[N]; }; static struct mergestruct merged; for (i = 0; i < N; ++i) { merged.foo[i] = merged.bar[i] * merged.baz[i]; } Great, now in addition I want to use an extra pointer to access the elements, like this: struct mergestruct *merged_ptr = &merged; for (i = 0; i < N; ++i) { merged_ptr->foo[i] = merged_ptr->bar[i] * merged_ptr->baz[i]; } So I add something like this after line 153: PointerType *MergedPointerType = PointerType::get(MergedTy, 0); GlobalVariable *MergedPointer = new GlobalVariable(M, MergedPointerTy...