summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-84/+84
| | | | | | | It is not needed after LLVM r327734. Now it will be easier to copy-paste IR symbol names from Clang. llvm-svn: 327738
* Bring r325915 back.Rafael Espindola2018-02-231-2/+2
| | | | | | | | | | | | | | | The tests that failed on a windows host have been fixed. Original message: Start setting dso_local for COFF. With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325940
* Revert "Start setting dso_local for COFF."Rafael Espindola2018-02-231-2/+2
| | | | | | | | This reverts commit r325915. It will take some time to fix the failures on a windows host. llvm-svn: 325929
* Start setting dso_local for COFF.Rafael Espindola2018-02-231-2/+2
| | | | | | | | | With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325915
* Implement C++ [basic.link]p8.Richard Smith2017-09-201-2/+5
| | | | | | | | | | | | | | If a function or variable has a type with no linkage (and is not extern "C"), any use of it requires a definition within the same translation unit; the idea is that it is not possible to define the entity elsewhere, so any such use is necessarily an error. There is an exception, though: some types formally have no linkage but nonetheless can be referenced from other translation units (for example, this happens to anonymous structures defined within inline functions). For entities with those types, we suppress the diagnostic except under -pedantic. llvm-svn: 313729
* [MS ABI] Mangle unnamed enums correctlyDavid Majnemer2016-12-251-0/+4
| | | | | | Unnamed enums take the name of the first enumerator they define. llvm-svn: 290509
* [MS ABI] Implement more of the Itanium mangling rulesDavid Majnemer2016-12-061-0/+25
| | | | | | | | | | | | We didn't implement handle corner cases like: - lambdas used to initialize a field - lambdas in default argument initializers This fixes PR31197. Differential Revision: https://reviews.llvm.org/D27226 llvm-svn: 288826
* [MSVC] Support for __unaligned qualifier in functionsAndrey Bokhanko2016-05-261-0/+9
| | | | | | | | | | | | | | | This implements support for MS-specific __unaligned qualifier in functions and makes the following test case both compile and mangle correctly: struct S { void f() __unaligned; }; void S::f() __unaligned { } Differential Revision: http://reviews.llvm.org/D20437 llvm-svn: 270834
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-111-0/+16
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367 and PR27666. Differential Revision: http://reviews.llvm.org/D20103 llvm-svn: 269220
* Revert r268727, it caused PR27666.Nico Weber2016-05-061-16/+0
| | | | llvm-svn: 268736
* [MSVC] Implementation of __unaligned as a proper type qualifierAndrey Bokhanko2016-05-061-0/+16
| | | | | | | | | | | This patch implements __unaligned (MS extension) as a proper type qualifier (before that, it was implemented as an ignored attribute). It also fixes PR27367. Differential Revision: http://reviews.llvm.org/D19654 llvm-svn: 268727
* Revert r266415, it broke parsing SDK headers (PR27367).Nico Weber2016-04-151-11/+0
| | | | llvm-svn: 266431
* [MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifierAndrey Bokhanko2016-04-151-0/+11
| | | | | | | | | | | This patch implements __unaligned as a type qualifier; before that, it was modeled as an attribute. Proper mangling of __unaligned is implemented as well. Some OpenCL code/tests are tangenially affected, as they relied on existing number and sizes of type qualifiers. Differential Revision: http://reviews.llvm.org/D18596 llvm-svn: 266415
* [MS ABI] Don't crash while mangling recursive lambdasDavid Majnemer2016-01-171-6/+13
| | | | | | | | | | | | | | | We might get into bad situations where we try to embed the signature of an inner lambda into an outer lambda which cannot work: the inner lambda wants to embed the name of the outer lambda! Instead, omit the return type for lambdas. This fixes PR26105. N.B. While we are here, make lambdas nested within functions use an artificial scope so that they can get demangled. llvm-svn: 258003
* [MS ABI] Mangle static anonymous unionsDavid Majnemer2015-10-221-0/+9
| | | | | | | | | | | | We believed that internal linkage variables at global scope which are not variable template specializations did not have to be mangled. However, static anonymous unions have no identifier and therefore must be mangled. This fixes PR18204. llvm-svn: 250997
* [MS ABI] Number unnamed TagDecls which aren't externally visibleDavid Majnemer2015-09-021-0/+16
| | | | | | | | | | | | TagDecls (structs, enums, etc.) may have the same name for linkage purposes of one another; to disambiguate, we add a number to the mangled named. However, we didn't do this if the TagDecl has a pseudo-name for linkage purposes (it was defined alongside a DeclaratorDecl or a TypeNameDecl). This fixes PR24651. llvm-svn: 246659
* [MS ABI] Correctly mangle classes without names for linkage purposesDavid Majnemer2015-08-311-0/+18
| | | | | | | | | | | | | | | | A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. llvm-svn: 246469
* MS ABI: Implement the MSVC 2015 scheme for scope disambiguationDavid Majnemer2015-03-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider C++ that looks like: inline int &f(bool b) { if (b) { static int i; return i; } static int i; return i; } Both 'i' variables must have distinct (and stable) names for linkage purposes. The MSVC 2013 ABI would number the variables using a count of the number of scopes that have been created. However, the final 'i' returns to a scope that has already been created leading to a mangling collision. MSVC 2015 fixes this by giving the second 'i' the name it would have if it were declared before the 'if'. However, this results in ABI breakage because the mangled name, in cases where there was no ambiguity, would now be different. We implement the new behavior and only enable it if we are targeting the MSVC 2015 ABI, otherwise the old behavior will be used. This fixes PR18131. llvm-svn: 232766
* MS ABI: Empty pack expansions had their mangling changed in 2013->2015David Majnemer2015-03-181-3/+6
| | | | | | | | | | We used to support the 2013 mangling and changed it to the more reasonable 2015 mangling. Let's make the mangling conditional on what version of MSVC is targeted. This fixes PR21888. llvm-svn: 232609
* MS ABI: Mangle char16_t and char32_t typesDavid Majnemer2014-11-211-0/+6
| | | | | | | These mangling make clang more compatible with MSVC 2015. Correctly mangling char16_t and char32_t will take a little more work. llvm-svn: 222515
* MS ABI: Update alias template mangling for VC "14" CTP 3David Majnemer2014-08-191-1/+1
| | | | | | | | MSVC "14" CTP 3 has fixed it's mangling for alias templates when used as template-template arguments; update clang to be compatible with this mangling. llvm-svn: 215972
* MS ABI: Mangle this qualifiers on function typesDavid Majnemer2014-08-121-0/+53
| | | | | | | | | | | C++11 allows this qualifiers to exist on function types when used in template arguments. Previously, I believed it wasn't possible because MSVC rejected declarations like: S<int () const &> s; However, it turns out MSVC properly allows them in using declarations; updated clang to be compatible with this mangling. llvm-svn: 215464
* MS ABI: Mangle lambdas which are given the same mangling numberDavid Majnemer2014-08-061-4/+19
| | | | | | | | It is possible for lambdas to get the same mangling number because they may exist in different mangling contexts. To handle this correctly, mangle the context into the name as well. llvm-svn: 214947
* MS ABI: Mangle empty type parameter packs compatiblyDavid Majnemer2014-08-051-0/+12
| | | | | | | | | | | The MS mangling scheme apparently has separate manglings for type and non-type parameter packs when they are empty. Match template arguments with parameters during mangling; check the parameter to see if it was destined to hold type-ish things or nontype-ish things. Differential Revision: http://reviews.llvm.org/D4792 llvm-svn: 214932
* MS ABI: Make the alias template mangling more correctDavid Majnemer2014-08-051-1/+1
| | | | llvm-svn: 214847
* MS ABI: Mangle alias templates used as template-template argumentsDavid Majnemer2014-07-301-0/+14
| | | | | | | | | | | | | A templated using declaration may be used as a template-template argument. Unfortunately, the VS "14" chooses '?' as the sole marker for the argument. This is problematic because it presupposes the possibility of using more than one template-aliases as arguments to the same template. This fixes PR20047. llvm-svn: 214290
* MS-ABI: Mangle empty template parameter packs correctlyDavid Majnemer2014-06-041-0/+6
| | | | | | Tested for compatibility with VS2013. llvm-svn: 210198
* MS-ABI: Implement user defined literalsDavid Majnemer2014-06-041-0/+3
| | | | | | | | | Straightforward implementation of UDLs, it's compatible with VS "14". This nearly completes our implementation of C++ name mangling for the MS-ABI. llvm-svn: 210197
* MS ABI: Implement mangling for ref-qualifiers on methodsDavid Majnemer2014-04-231-0/+11
| | | | | | | | Mangle ref-qualifiers like the Nov 2013 CTP. This fixes PR19361. llvm-svn: 206946
* MS ABI: Mangle lambdasDavid Majnemer2014-03-051-0/+18
| | | | | | | | | | | | | | | | Use a scheme inspired by the Itanium ABI to properly implement the mangling of lambdas. N.B. The incredibly astute observer will notice that we do not generate external names that are identical, or even compatible with, MSVC. This is fine because they don't generate names that they can use across translation units. Technically, we can generate any name we'd like so long as that name wouldn't conflict with any other and would be stable across translation units. This fixes PR15512. llvm-svn: 202962
* MS ABI: Reorganize some testsDavid Majnemer2014-03-041-0/+89
| | | | | | Move some c++11 specific tests to mangle-ms-cxx11 llvm-svn: 202790
* MSVC ABI: Support C++11's auto on variablesDavid Majnemer2014-01-211-0/+3
| | | | | | | | | | The MSVC C++ ABI always uses the deduced type in place of auto when generating external names for variables. N.B. MSVC doesn't support C++1y's 'operator auto' and this patch will not give us said functionality. llvm-svn: 199764
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-1/+1
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* MS: Mangle rvalue references and nullptr_t, and produce back-references whenRichard Smith2012-06-211-0/+11
appropriate. Patch by João Matos! llvm-svn: 158895
OpenPOWER on IntegriCloud