]> granicus.if.org Git - clang/commit
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)
commitcf426329e10785b7479df0cde8c65489c212808a
tree0532488329e13f59843834801bd1eeb4e7f6b54f
parent6b006047e2e7c04538880f2b980ecb3052053b5a
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222564 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/MicrosoftMangle.cpp
test/CodeGenCXX/mangle-ms-string-literals.cpp