MS ABI: Mangle char16_t and char32_t string literals
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 21 Nov 2014 19:57:25 +0000 (19:57 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 21 Nov 2014 19:57:25 +0000 (19:57 +0000)
commit98e77a2512115a8f8853a8342e02727984c07e79
treeaa5422449db83e368a15e920ff093122796b0680
parentf0a582bada4e77e2b06a0f37b7cf06703971f26f
MS ABI: Mangle char16_t and char32_t string literals

We previously had support for char and wchar_t string literals.  VS 2015
added support for char16_t and char32_t.

String literals must be mangled in the MS ABI in order for them to be
deduplicated across translation units: their linker has no notion of
mergeable section.  Instead, they use the mangled name to make a COMDAT
for the string literal; the COMDAT will merge with other COMDATs in
other object files.

This allows strings in object files generated by clang to get merged
with strings in object files generated by MSVC.

llvm-svn: 222564
clang/lib/AST/MicrosoftMangle.cpp
clang/test/CodeGenCXX/mangle-ms-string-literals.cpp