<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 23, 2015 at 6:38 AM, Wu Zhao <span dir="ltr"><<a href="mailto:bluechristlove@163.com" target="_blank">bluechristlove@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Maybe the title is somehow confused. but let me show you a example.</div><div><br></div><div>[code]</div><div><br></div><div>void foo(int val)</div><div>{</div><div>    // do something</div><div>}</div><div><br></div><div>int i = 27;</div><div>int* pi = &i;</div><div><br></div><div>foo(*pi);</div><div><br></div><div>[/code]</div><div><br></div><div><br></div><div>Here, if we compile it using clang, the type of *pi will be i32, but we know pi is pointer type. </div><div><br></div><div>my question is we use Function::getgetFunctionParamType method, the result will be i32. but how do I use some wayst to get ' pi ' type, not ' *pi ' type?  This problem has confused me some days. </div></div></blockquote><div><br>I'm not clear on exactly what you want, sorry - if you're examining the 'foo' function in LLVM IR, then there's no remnant of the type of 'pi' - that's an artefact of the call site, but the actual function takes an i32.<br><br>If you look at the call site to foo, then you can walk the operands of the call instruction and look through the subexpressions - there should be a load instruction you can look through to find the raw pointer that was loaded from.<br><br>- David<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><br></div><div>Thanks </div><div><br></div><div>Best Regards</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Wu Zhao</div></font></span></div><br><br><span title="neteasefooter"><span></span></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>