[cfe-dev] libclang-based semantic-diff tool

Gonzalo BG via cfe-dev cfe-dev at lists.llvm.org
Fri May 20 02:08:16 PDT 2016


Does anybody know of a libclang-based semantic-diff tool or is working on
one?

Things I am looking for:

- ability to ignore _all_ formatting while diff'ing files (e.g. be able to
diff 2 files formatted with completely different styles and show only
non-formatting related changes)

- semantic diffs, e.g., if a class variable was renamed, instead of giving
a diff on every usage of the variable, I would like to get only 1 diff:
"this class variable was changed", used 10000 times, and then be able to
see/merge/edit the diffs at a semantic level. The same for function names,
class names, macros, namespaces...

A problem introduced by clang format is that as bugs get fixed and new
versions get released and as developers work with different versions of it
formatting changes creep into source code repositories along real changes.
Being able to filter out this noise would be very valuable.

Right now the situation with clang-format is "don't ever think about source
code formatting again, _until_ you need to commit", which is way better
than what we had, but still not perfect. I don't want to ever think about
formatting again, not even while diff'ing and/or committing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160520/8609ed41/attachment.html>


More information about the cfe-dev mailing list