libclang-based semantic-diff tool

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.

Nope, feel free to write one :slight_smile: