Biohazrd icon indicating copy to clipboard operation
Biohazrd copied to clipboard

`InlineExportHelper` should use a hash of the function's mangled names for export helper names to reduce diff churn

Open PathogenDavid opened this issue 2 years ago • 1 comments

It is useful to be able to use diffs to see how changes in Biohazrd affect the output of a given library's generation. However right now InlineExportHelper output tends to cause a lot of annoying-to-read diff churn when its output is affected in all but the most trivial ways.

Instead of using a monotonically increasing number we should use a hash of the function's mangled name. (Can't use the unmangled name because of overloads.)

One downside of using mangled names is that they will be different between platforms. Might consider something else like a hash of the function type's Clang spelling or the canonical location of the function. (Spelling might be hard to get right and be slow. Canonical location will cause a different type of churn when the library is updated.)

PathogenDavid avatar Aug 05 '21 19:08 PathogenDavid

When we do this we should also de-duplicate the inline export helpers and emit them in some sorted order. (The former should fall out of this naturally.)

Right now when TranslatedFunction instances are duplicate (IE: for lifting base members) we end up emitting the same helper more than once.

PathogenDavid avatar Apr 28 '22 17:04 PathogenDavid