<div dir="ltr"><div>Maurizio, what you mentioned remind me about this discussion...</div><div><br></div><div>  <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035129.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035129.html</a><br></div><div><br></div><div>regards,</div><div>Laszlo</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 5:40 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Oct 4, 2014, at 2:37 AM, David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:<br>
> On 3 Oct 2014, at 17:32, Maurizio Vitale <<a href="mailto:mrz.vtl@gmail.com">mrz.vtl@gmail.com</a>> wrote:<br>
><br>
>> G'day everybody,<br>
>>  I vaguely remember that there was some tought/work on having a semantics-based diff tool on top of clang. Did I dream of this? any pointers to the discussion?<br>
>><br>
>> Maurizio<br>
><br>
</span><span class="">> One of my students worked on a project to do this using libclang and the Python bindings last year.  His goal was to identify common refactorings and present them in a human-readable form (including things like 'Variable x was renamed y in every use except those in foo.c').  His code probably isn't in a very good state to be reusable, but I'm sure he'd be happy to share his experiences with you.<br>
<br>
</span>I’d love to see someone pursue this.<br>
There’s lots of things that one could build upon a smart diff tool.<br>
<br>
Finding similar chunks of code.<br>
Detecting botched refactoring.<br>
Etc. Etc.<br>
<br>
<br>
Rambling to follow …<br>
<br>
A long time ago, I worked on a horrible code base; the result of years of copy/paste development.<br>
We had a tool called (I think) Pattern Insight that found these two chunks of code (actual duplicated code was about 60 lines long)<br>
<br>
blah blah global1 blah blah<br>
blah blah blah blah blah<br>
blah blah blah blah global1<br>
blah global1 blah global1 blah blah<br>
global1 blah blah blah blah<br>
blah blah global1 blah blah<br>
<br>
— and —<br>
<br>
blah blah global2 blah blah<br>
blah blah blah blah blah<br>
blah blah blah blah global2<br>
blah global1 blah global2 blah blah<br>
global2 blah blah blah blah<br>
blah blah global2 blah blah<br>
<br>
And said (paraphrased) “Did you really mean ‘global1’ on line 4 of that second chunk?”<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
— Marshall<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>