This is an archive of the discontinued LLVM Phabricator instance.

[ms] Fix mangling of char16_t and char32_t to be compatible with MSVC.
ClosedPublic

Authored by thakis on Jun 29 2018, 10:49 AM.

Details

Reviewers
majnemer
hans
Summary

MSVC limits char16_t and char32_t string literal names to 32 bytes of character data, not to 32 characters. wchar_t string literal names on the other hand can get up to 64 bytes of character data.

Diff Detail

Event Timeline

hans accepted this revision.Jul 2 2018, 5:09 AM

lgtm with nit

clang/lib/AST/MicrosoftMangle.cpp
3262

was the change from Mangle to Write for the suffix intentional? Mangle seems more fitting.

clang/test/CodeGenCXX/mangle-ms-string-literals.cpp
751

Oh, your godbolt does u"0123456789012345" (extra 5 at end here). If I drop that, the manglings match.

This revision is now accepted and ready to land.Jul 2 2018, 5:09 AM
thakis added a comment.Jul 2 2018, 5:36 AM

Thanks, landed with nit addressed in r336097.

thakis closed this revision.Jul 11 2018, 7:16 AM