[LLVMdev] convert GetElemtPtr result to pointer on element?

Alexander Poddey alexander.poddey at gmx.net
Tue May 26 11:16:46 PDT 2015


Hi all,
I'm still struggling with getElementPtr.

I have a global variable (array of doubles).
I can use ConstantExpr::getGetElementPtr(myGlobalVariable, indices) and use 
the result as argument of e.g. a function. I read the GEP docu and know that 
I need anextra leading '0' index to dereference the global's pointer.
So far so good.
But I can not succeed in using the getGetElementPtr result in constructing 
an initalizer for another global value (which expects a ConstantFP* and not 
a ConstantExpr*).

I guess I have a missconception, but I can't figure it out...

Alex 








More information about the llvm-dev mailing list