[PATCH] D48781: [ms] Fix mangling of char16_t and char32_t to be compatible with MSVC.

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 2 05:09:19 PDT 2018


hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.

lgtm with nit



================
Comment at: clang/lib/AST/MicrosoftMangle.cpp:3262
+  // Enforce our 32 bytes max, except wchar_t which gets 32 chars instead.
+  unsigned MaxBytesToWrite = SL->isWide() ? 64U : 32U;
+  unsigned NumBytesToWrite = std::min(MaxBytesToWrite, SL->getByteLength());
----------------
was the change from Mangle to Write for the suffix intentional? Mangle seems more fitting.


================
Comment at: clang/test/CodeGenCXX/mangle-ms-string-literals.cpp:751
+const char16_t *MaxU16String = u"012345678901234";
+// CHECK: @"??_C at _0CA@NFEFHIFO at 0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA?$AA?$AA@"
+const char32_t *MaxU32String = U"0123456";
----------------
Oh, your godbolt does u"0123456789012345" (extra 5 at end here). If I drop that, the manglings match.


https://reviews.llvm.org/D48781





More information about the cfe-commits mailing list