Skip to content

[dmd-cxx] Mangled Symbols now back reference types and identifiers#12079

Merged
dlang-bot merged 2 commits intodlang:dmd-cxxfrom
ibuclaw:dmd-cxx-backrefs
Dec 30, 2020
Merged

[dmd-cxx] Mangled Symbols now back reference types and identifiers#12079
dlang-bot merged 2 commits intodlang:dmd-cxxfrom
ibuclaw:dmd-cxx-backrefs

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Dec 30, 2020

Backported from #6998 - fixes issues with at least OSX and Solaris linkers, which both segfault when handling long symbol names.

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 phobos unittest build is reduced by a factor of about 3, while the longest symbol shrinks from 416133 to 1142 characters.

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
phobos unittest build is reduced by a factor of about 3, while the
longest symbol shrinks from 416133 to 1142 characters.
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "dmd-cxx + dmd#12079"

@ibuclaw
Copy link
Member Author

ibuclaw commented Dec 30, 2020

@thewilsonator approved these changes 41 seconds ago

Of course there's going to be some hidden dmd-specific issues that didn't crop up when testing gdc. :-)

@dlang-bot dlang-bot merged commit 2bd4fc3 into dlang:dmd-cxx Dec 30, 2020
@ibuclaw ibuclaw deleted the dmd-cxx-backrefs branch December 30, 2020 14:11
jpf91 pushed a commit to D-Programming-GDC/gcc that referenced this pull request Dec 31, 2020
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: dlang/dmd#12079

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 2bd4fc3fe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants