From: David Majnemer Date: Fri, 21 Nov 2014 23:56:50 +0000 (+0000) Subject: MS ABI: Mangle u8 string literals X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a144208ca4a0bdb31361def792203f023c1644c8;p=clang MS ABI: Mangle u8 string literals UTF8 string literals are mangled just like ASCII string literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222591 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 0530ca1be4..cae41602a1 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -338,7 +338,8 @@ bool MicrosoftMangleContextImpl::shouldMangleCXXName(const NamedDecl *D) { bool MicrosoftMangleContextImpl::shouldMangleStringLiteral(const StringLiteral *SL) { - return SL->isAscii() || SL->isWide() || SL->isUTF16() || SL->isUTF32(); + return SL->isAscii() || SL->isWide() || SL->isUTF8() || SL->isUTF16() || + SL->isUTF32(); } void MicrosoftCXXNameMangler::mangle(const NamedDecl *D, StringRef Prefix) { diff --git a/test/CodeGenCXX/mangle-ms-string-literals.cpp b/test/CodeGenCXX/mangle-ms-string-literals.cpp index a282190de4..e5ebc086e1 100644 --- a/test/CodeGenCXX/mangle-ms-string-literals.cpp +++ b/test/CodeGenCXX/mangle-ms-string-literals.cpp @@ -719,6 +719,8 @@ const wchar_t *LongWideString = L"012345678901234567890123456789ABCDEF"; // CHECK: @"\01??_C@_1EK@KFPEBLPK@?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AA0?$AA1?$AA2?$AA3?$AA4?$AA5?$AA6?$AA7?$AA8?$AA9?$AAA?$AAB@" const wchar_t *UnicodeLiteral = L"\ud7ff"; // CHECK: @"\01??_C@_13IIHIAFKH@?W?$PP?$AA?$AA@" +const char *U8Literal = u8"hi"; +// CHECK: @"\01??_C@_02PCEFGMJL@hi?$AA@" const char16_t *U16Literal = u"hi"; // CHECK: @"\01??_C@_05OMLEGLOC@h?$AAi?$AA?$AA?$AA@" const char32_t *U32Literal = U"hi";