summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms-string-literals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ms] Fix mangling of char16_t and char32_t to be compatible with MSVC.Nico Weber2018-07-021-0/+26
| | | | | | | | | | MSVC limits char16_t and char32_t string literal names to 32 bytes of character data, not to 32 characters. wchar_t string literal names on the other hand can get up to 64 bytes of character data. https://reviews.llvm.org/D48781 llvm-svn: 336097
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-360/+360
| | | | | | | It is not needed after LLVM r327734. Now it will be easier to copy-paste IR symbol names from Clang. llvm-svn: 327738
* MS ABI: Mangle u8 string literalsDavid Majnemer2014-11-211-0/+2
| | | | | | UTF8 string literals are mangled just like ASCII string literals. llvm-svn: 222591
* MS ABI: Mangle char16_t and char32_t string literalsDavid Majnemer2014-11-211-0/+4
| | | | | | | | | | | | | | | | 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
* MS ABI: Add a test for Unicode literalsDavid Majnemer2014-03-311-0/+2
| | | | | | | | | This adds coverage for Unicode code points which are encoded with non-zero values in the upper half of the wchar_t. No functionality change. llvm-svn: 205251
* MS ABI: Eliminate Duplicate StringsDavid Majnemer2014-03-241-0/+719
| | | | | | | | | | | | | | | | | | | | | | | | COFF doesn't have mergeable sections so LLVM/clang's normal tactics for string deduplication will not have any effect. To remedy this we place each string inside it's own section and mark the section as IMAGE_COMDAT_SELECT_ANY. However, we can only do this if the string has an external name that we can generate from it's contents. To be compatible with MSVC, we must use their scheme. Otherwise identical strings in translation units from clang may not be deduplicated with translation units in MSVC. This fixes PR18248. N.B. We will not attempt to do anything with a string literal which is not of type 'char' or 'wchar_t' because their compiler does not support unicode string literals as of this date. Further, we avoid doing this if either -fwritable-strings or -fsanitize=address are present. This reverts commit r204596. llvm-svn: 204675
* Revert r204562,204566,204586,204587 as they broke ASan on WindowsTimur Iskhodzhanov2014-03-241-719/+0
| | | | llvm-svn: 204596
* MS ABI: Add tests, other cleanups for r204562David Majnemer2014-03-241-0/+719
This commit cleans up a few accidents: - Do not rely on the order in which StringLiteral lays out bytes. - Use a more efficient mechanism for handling so-called "special-mappings" when mangling string literals. - There is no need to allocate a copy of the mangled name. - Add the test written for r204562. Thanks to Richard Smith for pointing these out! llvm-svn: 204586
OpenPOWER on IntegriCloud