[LLVMdev] A question about getElementPtr

Reid Spencer rspencer at reidspencer.com
Tue Nov 7 15:34:25 PST 2006


Robert,

Perhaps this will help:
http://llvm.org/docs/GetElementPtr.html

You should be able to just retain the pointer type as you traverse the
arrays/structs.

Reid.

On Tue, 2006-11-07 at 14:56 -0800, Robert Mykland wrote:
> I'm busy writing the code that translates the LLVM construct 
> GetElementPtr into my virtual circuit representation.  Since 
> GetElementPtr handles structures, I can end up at the end with a pointer 
> to some literal type, and know the literal type, but not know the 
> pointer type of what I have, at least not explicitly from the bytecode.
> 
> This has made me think I have to massage my context table so that 
> literal types can find their pointer types just so I can properly put 
> this resulting pointer into the correct type/value slot.
> 
> Am I missing something here?  Sure would be nice if the resulting type 
> were explicit in the instruction.
> 
> Cheers,
> 
> -- Robert.
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list