<div dir="ltr"> John, thanks for you answer! But as far as I know LLVM doesn't provide any interface for finding the pointee of a pointer directly, so i have to process a multi-level pointer i need to write my own function to check pointers level by level, is that right?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 1:47 PM, John Criswell <span dir="ltr"><<a href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<div>On 7/17/15 12:38 PM, Shen Liu wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi all, as a LLVM beginner I would like to know how
can i check the pointer types with different levels like int 32*
and int 32**, int 32***?
<div><br>
</div>
<div>By using value->getType()->isPointerTy() i can just
know they are pointers. But the dump results clearly show they
are different. Is there a good way to calculate their actual
point to levels? Thanks!</div>
</div>
</blockquote>
<br></span>
You will need to use dyn_cast<PointerType> to cast the Type *
into a PointerType *. Once you do that, you can find the Type *
that the PointerType points to.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Shen</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
<pre cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=fLieRv3uc9kbhg358mlk50g7cprXLe1bXr3IqftkA3Q&s=-yvD_h52sSZpEJH8t1dXdMdp-mjmFa8N4O3DFFZ9Hj0&e=" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
</font></span></div>
</blockquote></div><br></div>