<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Qiuping,<div class=""><br class=""></div><div class="">I guess you need to use getPointerOperand to access the pointer operand (@globalArg in your example) and idx_begin/idx_end iterators to access indexes. You can find a short description of these functions in documentation [1], or look at examples of their uses in the code, e.g. in lib/Transforms/InstCombine/*.cpp.</div><div class=""><br class=""></div><div class="">[1] <a href="http://llvm.org/doxygen/classllvm_1_1GetElementPtrInst.html" class="">http://llvm.org/doxygen/classllvm_1_1GetElementPtrInst.html</a></div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Michael</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 22, 2014, at 12:32 AM, Qiuping Yi <<a href="mailto:yiqiuping@gmail.com" class="">yiqiuping@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi, all</div><div class=""><br class=""></div><div class="">I am a LLVM user. I want to get every element in the next instruction:</div><div class=""><br class=""></div><div class="">%0 = load i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32 2), align 4, !dbg !85, !clap !86</div><div class=""><br class=""></div><div class="">Now I can only get value "i32* getelementptr inbounds (%struct.Args* @globalArg, i64 0, i32 2)" through "getOperand(0)",</div><div class="">but I can not get "%struct.Args* @globalArg", "i64 0", and "i32 2" in this instruction.</div><div class=""><br class=""></div><div class="">I know I can get the indices of getelementptr instructions through "getOperand()", but now in the previous example, </div><div class="">I want to get the indices from a getlementptr value. How should I do? Thank you in advance. </div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br clear="all" class=""><div class=""><div class="gmail_signature">Best Regards!</div><div class="gmail_signature"><br class="">--------------------------------------------<br class="">Qiuping Yi<br class="">Institute Of Software<br class="">Chinese Academy of Sciences</div></div>
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></div></body></html>