r222591 - MS ABI: Mangle u8 string literals
David Majnemer
david.majnemer at gmail.com
Fri Nov 21 15:56:50 PST 2014
Author: majnemer
Date: Fri Nov 21 17:56:50 2014
New Revision: 222591
URL: http://llvm.org/viewvc/llvm-project?rev=222591&view=rev
Log:
MS ABI: Mangle u8 string literals
UTF8 string literals are mangled just like ASCII string literals.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms-string-literals.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=222591&r1=222590&r2=222591&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Fri Nov 21 17:56:50 2014
@@ -338,7 +338,8 @@ bool MicrosoftMangleContextImpl::shouldM
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) {
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-string-literals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-string-literals.cpp?rev=222591&r1=222590&r2=222591&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-string-literals.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-string-literals.cpp Fri Nov 21 17:56:50 2014
@@ -719,6 +719,8 @@ const wchar_t *LongWideString = L"012345
// CHECK: @"\01??_C at _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 at _13IIHIAFKH@?W?$PP?$AA?$AA@"
+const char *U8Literal = u8"hi";
+// CHECK: @"\01??_C at _02PCEFGMJL@hi?$AA@"
const char16_t *U16Literal = u"hi";
// CHECK: @"\01??_C at _05OMLEGLOC@h?$AAi?$AA?$AA?$AA@"
const char32_t *U32Literal = U"hi";
More information about the cfe-commits
mailing list