<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2/8/16 9:39 AM, Mohammad Norouzi via
llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:CAFVz=BXpYqjbMvOAsiNZKsXtKN2JsJQueNf9vQ1Z3NzFTw6Brw@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi,<br>
<br>
I need to check if a variable belongs to the program
originally. Consider the following code line:<br>
<br>
</div>
<div>y = x + 4<br>
</div>
<div><br>
and its corresponding llvm ir (roughly):<br>
<br>
%16 = load i32 %x<br>
%add = add i32 %16, i32 4<br>
</div>
store i32 %add, %y<br>
<div>
<br>
I need to distinguish between %16, %add and %x, %y. <br>
</div>
</div>
</blockquote>
<br>
You might be able to use the Debug information embedded within the
LLVM IR to determine what is an original variable and what is a
temporary added by LLVM. However, I think that such an approach is
fragile.<br>
<br>
It sounds like you need to be analyzing Clang ASTs instead of LLVM
IR. The Clang AST represents a program in its original source form,
so you can tell what is a program variable, in what file it was
defined, its original source type, etc.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAFVz=BXpYqjbMvOAsiNZKsXtKN2JsJQueNf9vQ1Z3NzFTw6Brw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<br>
Any help is appreciated.<br>
<br>
Best,<br>
Mohammad</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>