[LLVMdev] opposite to CreateStructGEP

edA-qa mort-ora-y eda-qa at disemia.com
Sat Nov 16 21:11:09 PST 2013


Does getelementptr have a counterpart function which unindexes a
pointer? In particular, I'm using CreateStructGEP from the builder and
want to get back to the struct pointer from a member pointer.

fptr = b.CreateStructGEP( sptr, 2 );

//I want to do this
sptr = b.CreateUnStructGEP( fptr, sptr_type, 2 );


I know I can calculate the offsets on my own, but it'd be nice to not
have to since GEP already does it in the forward direction.

-- 
edA-qa mort-ora-y
Leaf Creator

Leaf - the language we always wanted
http://leaflang.org/



More information about the llvm-dev mailing list