In my main function, I have allocated an i8 pointer:
%a = alloca i8*, align 8
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @1, i32 0, i32 0), i8** %a, align 8
Is it possible to:
- assign a specific element (like arry[0] = 4)
- get a specific element (like arry[0])
How can I do that with the C++ API?
arr[4], then you use thegetelementptrinstruction. For example, to doarr[4] = 0, you'd create a GetElementPTrInst with indices 0,4, then a StoreInst with the gep as pointer operand and a constant int 4 as value operand. I can't reach the llvm.org site now and don't have my old compiler code on this computer, so I can't properly anwer.