summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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
* MS: Mangle rvalue references and nullptr_t, and produce back-references whenRichard Smith2012-06-211-0/+9
| | | | | | appropriate. Patch by João Matos! llvm-svn: 158895
* PR13047: Fix various abuses of clang::Type in the MS mangler, to make it workRichard Smith2012-06-081-2/+13
| | | | | | in the presence of type sugar. llvm-svn: 158184
* PR13022: cope with parenthesized function types in MS name mangling.Richard Smith2012-06-041-0/+5
| | | | llvm-svn: 157959
* Refactor the C++ ABI code a little bit to take advantage ofJohn McCall2012-05-011-3/+2
| | | | | | | | what I'm going to treat as basically universal properties of array-cookie code. Implement MS array cookies on top of that. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155886
* When mangling a synthetic function declaration, we might not haveJohn McCall2012-05-011-0/+14
| | | | | | | type-source information for its parameters. Don't crash when mangling them in the MS C++ ABI. Patch by Timur Iskhodzhanov! llvm-svn: 155879
* Add Microsoft mangling of constructors and destructors. Patch by Dmitry!Michael J. Spencer2011-12-011-1/+12
| | | | llvm-svn: 145581
* Use the right calling convention when mangling names in the Microsoft C++Charles Davis2010-11-091-5/+3
| | | | | | | | mangler. Now member functions and pointers thereof have their calling convention mangled as __thiscall if they have the default CC (even though, they technically still have the __cdecl CC). llvm-svn: 118598
* Mangle Objective-C pointers and block pointers in the Microsoft C++ Mangler.Charles Davis2010-07-031-3/+7
| | | | | | | | | | ObjC pointers were easy enough (as far as the ABI is concerned, they're just pointers to structs), but I had to invent a new mangling for block pointers. This is particularly worrying with the Microsoft ABI, because it is a vendor-specific ABI; extending it could come back to bite us later when MS extends it on their own (and you know they will). llvm-svn: 107572
* Fix mangling of array dimensions in the Microsoft C++ Mangler.Charles Davis2010-07-031-2/+2
| | | | llvm-svn: 107568
* Mangle member pointer types in the Microsoft C++ Mangler.Charles Davis2010-07-031-0/+6
| | | | llvm-svn: 107567
* Fix mangling of function pointers in the Microsoft C++ Mangler.Charles Davis2010-07-031-0/+3
| | | | llvm-svn: 107564
* Fix mangling of array parameters for functions in the Microsoft C++ Mangler.Charles Davis2010-07-031-1/+1
| | | | | | | | | | | Only actual functions get mangled correctly; I don't know how to fix it for function pointers yet. Thanks to John McCall for the hint. Also, mangle anonymous tag types. I don't have a suitable testcase yet; I have a feeling that that's going to need support for static locals, and I haven't figured out exactly how MSVC's scheme for mangling those works. llvm-svn: 107561
* Mangle arrays in the Microsoft C++ Mangler. It's not quite finished (itCharles Davis2010-06-301-0/+10
| | | | | | | | | doesn't mangle array parameters right), but I think that should be fixed in Sema (Doug, John, what do you think?). Also, stub out the remaining mangleType() routines. llvm-svn: 107264
OpenPOWER on IntegriCloud