[LLVMdev] newbie question on getelementptr
jay.gelisah at gmail.com
Tue Sep 18 21:52:47 PDT 2012
I'm new to LLVM and I'm having a coding problem.
I'm creating a GlobalVariable that contains a StructType that contains a
Function. The function returns i32 and takes two i32's.
Here is my code:
GlobalVariable* retrieved = module->getGlobalVariable("myGV");
Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices);
How do I get my Function back from the Constant* result? I'd like to be
able to run the function.
result->dump() shows the following:
i32 (i32, i32)** getelementptr inbounds (%myStruct* @myGV, i32 0, i32 0)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev