<div dir="ltr">Check it's type to see if it's a pointer or not?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 1 September 2013 12:31, Abhinash Jain <span dir="ltr"><<a href="mailto:omnia@mailinator.com" target="_blank">omnia@mailinator.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">C Code :-<br>
int main()<br>
{<br>
int a=10,c;<br>
int *b;<br>
c=20;<br>
*b=a;<br>
return 0;<br>
}<br>
<br>
IR of above code :-<br>
define i32 @main() #0 {<br>
entry:<br>
1. %retval = alloca i32, align 4<br>
2. %a = alloca i32, align 4<br>
3. %c = alloca i32, align 4<br>
4. %b = alloca i32*, align 8<br>
5. store i32 0, i32* %retval<br>
6. store i32 10, i32* %a, align 4<br>
7. store i32 20, i32* %c, align 4<br>
8. %0 = load i32* %a, align 4<br>
9. %1 = load i32** %b, align 8<br>
10. store i32 %0, i32* %1, align 4<br>
11. ret i32 0<br>
}<br>
<br>
<br>
Line 8,9,10 of IR represents *b=a;<br>
<br>
Now I want to recognise whether i32* %1 on line 10 is a pointer variable or<br>
ordinary variable through llvm pass.<br>
So how to solve this issue ???<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://llvm.1065342.n5.nabble.com/Distinguishing-Pointer-Variable-and-Ordinary-Variable-tp60881.html" target="_blank">http://llvm.1065342.n5.nabble.com/Distinguishing-Pointer-Variable-and-Ordinary-Variable-tp60881.html</a><br>
Sent from the LLVM - Dev mailing list archive at Nabble.com.<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>
</blockquote></div><br></div>