<div dir="ltr">There's no structural identity of code in Clang that I know of - I know someone's building a tool for doing structural similarity for things like plagiarism detection (I think there are some patches on the clang mailing list).<br><br>But if you only need identity within a single process, the pointer value of the pointer to any AST construct is a unique identity you can use.<br><br>(line/file/column isn't sufficiently unique - you could have a file that is included under different macro situations and each time it defines a different function, but all those functions would appear to be defined on the same line/file of that included file - or a macro that defines multiple functions - both can be resolved by looking at the more complete location information (including macro locations, etc))</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 26, 2016 at 5:11 AM folkert via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
The Sun java compiler allows you to (from java) walk the AST and<br>
investigate it. Each token is stored in an object. Each object has a<br>
hash() method which uniquely identifies it.<br>
<br>
Now I was wondering: can I do so with the LLVM tooling as well? I could<br>
of course if I want to identify e.g. a function name just pick the line-<br>
and column number and maybe include the function name itself as well but<br>
that would constantly change when lines are added and/or removed.<br>
<br>
Any suggestions?<br>
<br>
<br>
regards,<br>
<br>
Folkert van Heusden<br>
<br>
--<br>
---------------------------------------------------------------------<br>
Phone: +31-6-41278122, PGP-key: 1F28D8AE, <a href="http://www.vanheusden.com" rel="noreferrer" target="_blank">www.vanheusden.com</a><br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div>