[LLVMdev] How to get the indices in an getelementptr Value?

Qiuping Yi yiqiuping at gmail.com
Sat Nov 22 00:32:28 PST 2014


Hi, all

I am a LLVM user. I want to get every element in the next instruction:

%0 = load i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32
2), align 4, !dbg !85, !clap !86

Now I can only get value "i32* getelementptr inbounds (%struct.Args*
@globalArg, i64 0, i32 2)" through "getOperand(0)",
but I can not get "%struct.Args* @globalArg", "i64 0", and "i32 2" in this
instruction.

I know I can get the indices of getelementptr instructions through
"getOperand()", but now in the previous example,
I want to get the indices from a getlementptr value. How should I do? Thank
you in advance.

Best Regards!

--------------------------------------------
Qiuping Yi
Institute Of Software
Chinese Academy of Sciences
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141122/48fa8fff/attachment.html>


More information about the llvm-dev mailing list