summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add mangling test coverage for non-volatile const member pointersNico Weber2019-06-021-0/+4
| | | | llvm-svn: 362331
* Add a spelling of pass_object_size that uses __builtin_dynamic_object_sizeErik Pilkington2019-03-191-0/+2
| | | | | | | | | | | The attribute pass_dynamic_object_size(n) behaves exactly like pass_object_size(n), but instead of evaluating __builtin_object_size on calls, it evaluates __builtin_dynamic_object_size, which has the potential to produce runtime code when the object size can't be determined statically. Differential revision: https://reviews.llvm.org/D58757 llvm-svn: 356515
* Disable _Float16 for non ARM/SPIR TargetsErich Keane2019-01-251-1/+4
| | | | | | | | | | | | | | As Discussed here: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129543.html There are problems exposing the _Float16 type on architectures that haven't defined the ABI/ISel for the type yet, so we're temporarily disabling the type and making it opt-in. Differential Revision: https://reviews.llvm.org/D57188 Change-Id: I5db7366dedf1deb9485adb8948b1deb7e612a736 llvm-svn: 352221
* [MS] Mangle a hash of the main file path into anonymous namespacesReid Kleckner2018-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is needed to avoid conflicts in mangled names for codeview types in anonymous namespaces. In CodeView, types refer to each other typically through forward declarations, which contain mangled names. These names have to be unique, otherwise the debugger will look up the mangled name and find the wrong definition. Furthermore, ThinLTO will deduplicate the types, and debug info verification can fail when the types have the wrong sizes. This is PR38608. Fixes PR38609. Reviewers: majnemer, inglorion, hans Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50877 llvm-svn: 340079
* Add Microsoft mangling for _Float16Erich Keane2018-04-171-0/+4
| | | | | | | | | | | | Enables _Float16 on Windows by creating a mangling mechanism in MicrosoftMangle. It accomplishes this by mangling as a structure type of __clang::_Float16, similar to how Complex works. Patch By: mibintc Differential Revision: https://reviews.llvm.org/D45738 llvm-svn: 330225
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-116/+116
| | | | | | | 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-8/+8
| | | | | | | | | | | | | | | 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-8/+8
| | | | | | | | 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-8/+8
| | | | | | | | | 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
* [Sema] Allow unmarked overloadable functions.George Burgess IV2017-06-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the `overloadable` attribute to allow for one function with a given name to not be marked with the `overloadable` attribute. The overload without the `overloadable` attribute will not have its name mangled. So, the following code is now legal: void foo(void) __attribute__((overloadable)); void foo(int); void foo(float) __attribute__((overloadable)); In addition, this patch fixes a bug where we'd accept code with `__attribute__((overloadable))` inconsistently applied. In other words, we used to accept: void foo(void); void foo(void) __attribute__((overloadable)); But we will do this no longer, since it defeats the original purpose of requiring `__attribute__((overloadable))` on all redeclarations of a function. This breakage seems to not be an issue in practice, since the only code I could find that had this pattern often looked like: void foo(void); void foo(void) __attribute__((overloadable)) __asm__("foo"); void foo(int) __attribute__((overloadable)); ...Which can now be simplified by simply removing the asm label and overloadable attribute from the redeclaration of `void foo(void);` Differential Revision: https://reviews.llvm.org/D32332 llvm-svn: 306467
* [MS ABI] Ignore transparent contexts when determining the effective contextDavid Majnemer2016-05-191-0/+5
| | | | | | | We didn't skip over extern "C++" contexts, causing us to mangle things which don't need to be mangled. llvm-svn: 270089
* [MS ABI] Complete and base constructor GlobalDecls must have the same nameDavid Majnemer2016-01-081-0/+25
| | | | | | | | | | | | | | | | | Clang got itself into the situation where we mangled the same constructor twice with two different constructor types. After one of the constructors were utilized, the tag used for one of the types changed from class to struct because a class template became complete. This resulted in one of the constructor types varying from the other constructor. Instead, force "base" constructor types to "complete" if the ABI doesn't have constructor variants. This will ensure that GlobalDecls for both variants will get the same mangled name. This fixes PR26029. llvm-svn: 257205
* [MS ABI] Improve our mangling of pass_object_sizeDavid Majnemer2015-12-301-0/+4
| | | | | | | | | | | | | | We didn't add the artificial pass_object_size arguments to the backreference map which bloated the size of manglings which involved pass_object_size with duplicate types. This lets us go from: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size1@3@@Z to: ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z llvm-svn: 256622
* [MS ABI] Invent a mangling for reference temporariesDavid Majnemer2015-12-291-0/+4
| | | | | | | | | MSVC is non-conforming and doesn't have a mangling for these. Invent our own to unblock folks using clang. This fixes PR25795. llvm-svn: 256589
* [MS ABI] Add a mangling for _ComplexDavid Majnemer2015-12-291-0/+4
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C99's _Complex so we must invent our own. For now, treating it like a class type called _Complex in the __clang namespace. This means that 'void f(__Complex int))' will demangle as: 'void f(struct __clang::_Complex<int>)' llvm-svn: 256583
* [MS ABI] Implement a mangling for _Atomic typesDavid Majnemer2015-12-291-0/+5
| | | | | | | | | | | | | MSVC doesn't implement a mangling for C11's _Atomic so we must invent our own. For now, treating it like a class type called _Atomic in the __clang namespace. This means that 'void f(__Atomic(int))' will demangle as: 'void f(struct __clang::_Atomic<int>)' llvm-svn: 256557
* Add the `pass_object_size` attribute to clang.George Burgess IV2015-12-021-0/+19
| | | | | | | | | | | | | `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring inlining to happen everywhere. A link to the design doc for this attribute is available at the Differential review link below. Differential Revision: http://reviews.llvm.org/D13263 llvm-svn: 254554
* [MS ABI] Correctly mangle classes without names for linkage purposesDavid Majnemer2015-08-311-0/+29
| | | | | | | | | | | | | | | | 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] Give __attribute__((overloadable)) functions pretty namesDavid Majnemer2015-05-181-0/+3
| | | | | | | | It turns out that there is a mangling for 'extern "C"', it's only used by MSVC in /clr mode. Co-opt this mangling so that extern "C" functions marked overloadable get demangled nicely. llvm-svn: 237548
* [MS ABI] Function encodings are always encoded in template argumentsDavid Majnemer2015-05-181-0/+6
| | | | llvm-svn: 237547
* MS ABI: Correctly mangle CV qualifiers from typedefsWill Wilson2014-11-051-0/+13
| | | | llvm-svn: 221344
* Add frontend support for __vectorcallReid Kleckner2014-10-241-0/+2
| | | | | | | | | | | | | Wire it through everywhere we have support for fastcall, essentially. This allows us to parse the MSVC "14" CTP headers, but we will miscompile them because LLVM doesn't support __vectorcall yet. Reviewed By: Aaron Ballman Differential Revision: http://reviews.llvm.org/D5808 llvm-svn: 220573
* MS ABI: Reorganize some testsDavid Majnemer2014-03-041-90/+2
| | | | | | Move some c++11 specific tests to mangle-ms-cxx11 llvm-svn: 202790
* MS ABI: Refactor extended qualifiersDavid Majnemer2014-02-181-0/+3
| | | | | | | Extended qualifiers can appear in many places, refactor the code so it's more reusable. Add tests in areas where we've increased compatibility. llvm-svn: 201574
* MS ABI: Add support for mangling __restrictDavid Majnemer2014-02-181-0/+5
| | | | | | | | | | | | Pointer types in the MSVC ABI are a bit awkward, the width of the pointer is considered a kind of CVR qualifier. Restrict is handled similarly to const and volatile but is mangled after the pointer width qualifier. This fixes PR18880. llvm-svn: 201569
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-2/+2
| | | | | | | | | | | | | | | 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
* Revert "[-cxx-abi microsoft] Mangle reference temporaries"David Majnemer2013-12-131-7/+0
| | | | | | | | | This reverts commit r197184. Richard Smith brings up some good points, a proper implementation will require us to mangle unnameable entities compatibly with MSVC. llvm-svn: 197192
* [-cxx-abi microsoft] Mangle reference temporariesDavid Majnemer2013-12-121-0/+7
| | | | | | | They are mangled the same as normal references, nothing special is going on here. llvm-svn: 197184
* [-cxx-abi microsoft] Properly mangle enumsDavid Majnemer2013-12-091-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing our ability to mangle large constants (PR18175), I incidentally discovered that we did not properly mangle enums correctly. Previously, we would append the width of the enum in bytes after the type-tag differentiator. This would mean "enum : short" would be mangled as 'W2' while "enum : char" would be mangled as 'W1'. Upon testing this with several versions of MSVC, I found that this did not match their behavior: they always use 'W4'. N.B. Quick testing uncovered that undname allows different numbers to follow the 'W' in the following way: 'W0' -> "enum char" 'W1' -> "enum unsigned char" 'W2' -> "enum short" 'W3' -> "enum unsigned short" 'W4' -> "enum" 'W5' -> "enum unsigned int" 'W6' -> "enum long" 'W7' -> "enum unsigned long" However this scheme appears abandoned, I cannot get MSVC to trigger it. Furthermore, it's incomplete: it doesn't handle "bool" or "long long". llvm-svn: 196752
* [-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>David Majnemer2013-11-251-2/+10
| | | | | | | | | | | | | | | It wasn't possible for an anonymous type to show up inside of function arguments. However, decltype (which MSVC added support for in 2010) makes this possible. Further, backrefs to these anonymous types can now be formed. This fixes PR18022. N.B. We do not, and very likely _will not_, support MSVC's bug where subsequent typedefs of anonymous types leak into the linkage name; this is a gross violation of the ABI. A warning should be introduced to inform our users of this particular shortcoming. llvm-svn: 195669
* [ms-cxxabi] Fix the calling convention for operator new in recordsReid Kleckner2013-10-081-0/+52
| | | | | | | | | | | | | | | | | | Summary: Operator new, new[], delete, and delete[] are all implicitly static when declared inside a record. CXXMethodDecl already knows this, but we need to account for that before we pick the calling convention for the function type. Fixes PR17371. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1761 llvm-svn: 192150
* Revert "Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately""David Majnemer2013-09-171-0/+29
| | | | | | This reverts commit r190895 which reverted r190892. llvm-svn: 190904
* Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately"David Majnemer2013-09-171-29/+0
| | | | | | This reverts commit r190892. llvm-svn: 190895
* [-cxx-abi microsoft] Mangle local TagDecls appropriatelyDavid Majnemer2013-09-171-0/+29
| | | | | | | | | | | | | | | | | | | | | | | Summary: When selecting a mangling for an anonymous tag type: - We should first try it's typedef'd name. - If that doesn't work, we should mangle in the name of the declarator that specified it as a declaration specifier. - If that doesn't work, fall back to a static mangling of <unnamed-type>. This should make our anonymous type mangling compatible. This partially fixes PR16994; we would need to have an implementation of scope numbering to get it right (a separate issue). Reviewers: rnk, rsmith, rjmccall, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1540 llvm-svn: 190892
* [-cxx-abi microsoft] Mangle user defined entry points properlyDavid Majnemer2013-09-131-0/+20
| | | | | | | | | | | | | | | | Summary: Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain" are never mangled regardless of linkage, even when compiling for kernel mode. Depends on D1655 Reviewers: timurrrr, pcc, rnk, whunt CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1670 llvm-svn: 190675
* [-cxx-abi microsoft] Mangle declarations inside extern "C"David Majnemer2013-09-131-0/+10
| | | | | | | | | | | | | | | Summary: This is a first step to getting extern "C" working properly inside clang. There are a number of quirks but mangling declarations inside such a function are a good first step. Reviewers: timurrrr, pcc, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1655 llvm-svn: 190671
* CHECK -> CHECK-DAGDavid Majnemer2013-09-131-82/+82
| | | | llvm-svn: 190670
* Add back a test that was removed in r188450David Majnemer2013-08-151-0/+1
| | | | llvm-svn: 188453
* [-cxx-abi microsoft] Mangle member pointers betterDavid Majnemer2013-08-151-1/+34
| | | | | | | | | | | | | | | | | | | | Summary: There were several things going wrong: - We mangled in useless qualifiers like "volatile void" return types. - We didn't propagate 64-bit pointer markers sufficiently. - We mangled qualifiers belonging to the pointee incorrectly. This fixes PR16844 and PR16848. Reviewers: rnk, whunt Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1353 llvm-svn: 188450
* [ms-cxxabi] Properly mangle member pointersDavid Majnemer2013-08-051-2/+2
| | | | | | | | | | There were three things missing from the original implementation: - We would omit the 'E' qualifier for members int 64-bit mode. - We would not exmaine the qualifiers in 'IsMember' mode. - We didn't generate the correct backref to the base class. llvm-svn: 187753
* [ms-cxxabi] Mangle in an implicit 'E' for certain types on win64Reid Kleckner2013-05-141-2/+18
| | | | | | | | | | | | Most of the complexity of this patch is figuring out which types get the qualifier and which don't. If we implement __ptr32/64, then we should check the qualifier instead of assuming all pointers are 64-bit. This fixes PR13792. Patch by Warren Hunt! llvm-svn: 181825
* [ms-cxxabi] Fix a number of bugs in the mangler.Peter Collingbourne2013-04-251-5/+2
| | | | | | | | | | | | | | This includes the following fixes: - Implement 4 subtly different variants of qualifier mangling and use them in what I believe are the right places. - Fix handling of array types. Previously we were always decaying them, which is wrong if the type appears as a template argument, pointee, referent etc. Fixes PR13182. Differential Revision: http://llvm-reviews.chandlerc.com/D709 llvm-svn: 180250
* Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoftTimur Iskhodzhanov2012-11-261-2/+9
| | | | llvm-svn: 168583
* Allowing individual targets to determine whether a given calling convention ↵Aaron Ballman2012-10-021-0/+2
| | | | | | | | is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs. Fixes PR13782 llvm-svn: 165015
* Fix PR13444 - wrong mangling of "const char * const *" and friends with ↵Timur Iskhodzhanov2012-09-031-5/+28
| | | | | | "-cxx-abi microsoft" llvm-svn: 163110
* Fix the mangling of function pointers in the MS ABI.John McCall2012-08-251-0/+4
| | | | | | Patch by Timur Iskhodzhanov! llvm-svn: 162638
* Remove an outdated comment; add one test to compare function pointer and ↵Timur Iskhodzhanov2012-07-261-3/+7
| | | | | | block mangling llvm-svn: 160783
* Follow-up: fix the quotesTimur Iskhodzhanov2012-07-231-3/+3
| | | | llvm-svn: 160626
* Replace wrong CHECK array mangling expectations with correct CHECK-NOT+FIXME ↵Timur Iskhodzhanov2012-07-231-4/+9
| | | | | | (PR13182) llvm-svn: 160625
* Add a few more test cases for the -cxx-abi microsoft mangler. Some of them ↵Timur Iskhodzhanov2012-06-271-2/+14
| | | | | | were broken recently llvm-svn: 159248
OpenPOWER on IntegriCloud