[LLVMdev] question about GetElementPtr Instruction

xli3 at uiuc.edu xli3 at uiuc.edu
Wed Sep 25 20:56:00 PDT 2002


I have a question about GetElementPtr. 

Suppose I have an GetElementPtr Instruction GI:

%reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint
5, uint 13

I want to check if this is the reference of a component of a
structure, how can I do that? Should I check which operand of
this instruction is 'ubyte' type? How can I do that in code?

should I use 
ubyte *a = dyn_cast<ubyte>GI.getoperand(i) or something else?

Thanks,
xiaodong



More information about the llvm-dev mailing list