d: Mangled Symbols now back reference types and identifiers
authorIain Buclaw <ibuclaw@gdcproject.org>
Thu, 31 Dec 2020 00:05:01 +0000 (01:05 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 31 Dec 2020 00:27:06 +0000 (01:27 +0100)
commit1af3f4a2893203492cce59b72eff3f7bb4aef04c
treedbd1963ce9412308ada1f4e24b98ee9b6376c9c5
parent5478fec4455d312396d0756f9048fc478453370d
d: Mangled Symbols now back reference types and identifiers

Symbols with extern(D) linkage are now mangled using back references to
types and identifiers if these occur more than once in the mangled name
as emitted before.  This reduces symbol length, especially with chained
expressions of templated functions with Voldemort return types.

For example, the average symbol length of the 127000+ symbols created by
a libphobos unittest build is reduced by a factor of about 3, while the
longest symbol shrinks from 416133 to 1142 characters.

Reviewed-on: https://github.com/dlang/dmd/pull/12079

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 2bd4fc3fe.
gcc/d/dmd/MERGE
gcc/d/dmd/dmangle.c
gcc/d/dmd/dtemplate.c
gcc/testsuite/gdc.test/compilable/testInference.d
gcc/testsuite/gdc.test/fail_compilation/fail12485.d
gcc/testsuite/gdc.test/runnable/imports/testmangle.d [new file with mode: 0644]
gcc/testsuite/gdc.test/runnable/link6574.d
gcc/testsuite/gdc.test/runnable/mangle.d
gcc/testsuite/gdc.test/runnable/template4.d
gcc/testsuite/gdc.test/runnable/template9.d
gcc/testsuite/gdc.test/runnable/testconst.d