[cfe-dev] clang based diff tool

Laszlo Nagy rizsotto.mailinglist at gmail.com
Tue Oct 7 02:41:33 PDT 2014


Maurizio, what you mentioned remind me about this discussion...

  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035129.html

regards,
Laszlo

On Mon, Oct 6, 2014 at 5:40 PM, Marshall Clow <mclow.lists at gmail.com> wrote:

>
> On Oct 4, 2014, at 2:37 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk>
> wrote:
> > On 3 Oct 2014, at 17:32, Maurizio Vitale <mrz.vtl at gmail.com> wrote:
> >
> >> G'day everybody,
> >>  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?
> >>
> >> Maurizio
> >
> > 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.
>
> I’d love to see someone pursue this.
> There’s lots of things that one could build upon a smart diff tool.
>
> Finding similar chunks of code.
> Detecting botched refactoring.
> Etc. Etc.
>
>
> Rambling to follow …
>
> A long time ago, I worked on a horrible code base; the result of years of
> copy/paste development.
> We had a tool called (I think) Pattern Insight that found these two chunks
> of code (actual duplicated code was about 60 lines long)
>
> blah blah global1 blah blah
> blah blah blah blah blah
> blah blah blah blah global1
> blah global1 blah global1 blah blah
> global1 blah blah blah blah
> blah blah global1 blah blah
>
> — and —
>
> blah blah global2 blah blah
> blah blah blah blah blah
> blah blah blah blah global2
> blah global1 blah global2 blah blah
> global2 blah blah blah blah
> blah blah global2 blah blah
>
> And said (paraphrased) “Did you really mean ‘global1’ on line 4 of that
> second chunk?”
>
>
> — Marshall
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141007/e0feb54e/attachment.html>


More information about the cfe-dev mailing list