summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MS] Mangle a hash of the main file path into anonymous namespacesReid Kleckner2018-08-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-24/+24
| | | | | | | 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
* Reinstate r239499 and r239503David Majnemer2015-06-111-2/+21
| | | | | | | They were reverted because the FileCheck patterns didn't match on release builds. llvm-svn: 239512
* Revert "[MS ABI] Allow fastcall member function pointers to get CodeGen'd"Manuel Klimek2015-06-111-21/+2
| | | | | | | | | | | | Revert "[MS ABI] Allow memfn pointers with unconvertible types to be formed" This reverts r239499 and r239503; the former breaks tests [1] and the latter is based on the former. [1] http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/4473/testReport/Clang/CodeGenCXX/microsoft_abi_virtual_member_pointers_cpp/ llvm-svn: 239511
* [MS ABI] Allow memfn pointers with unconvertible types to be formedDavid Majnemer2015-06-111-2/+21
| | | | | | | | Remove the restriction which forbade forming pointers to member functions which had parameter types or return types which were not convertible. llvm-svn: 239499
* [opaque pointer types] Explicit non-pointer type for call expressionsDavid Blaikie2015-04-161-12/+12
| | | | | | (migration for recent LLVM change to textual IR for calls) llvm-svn: 235147
* MS ABI: Mangle virtual member pointer thunks with the correct CCDavid Majnemer2015-03-141-0/+19
| | | | | | | | | | Virtual member pointers are implemented using a thunk. We assumed that the calling convention for this thunk was always __thiscall for 32-bit targets and __cdecl for 64-bit targets. However, this is not the case. Mangle in whichever calling convention is appropriate for this member function thunk. llvm-svn: 232254
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-10/+10
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-10/+10
| | | | llvm-svn: 230783
* Add the "thunk" attribute to MS ABI virtual member pointersReid Kleckner2015-01-211-4/+14
| | | | | | | | | | | | | | | | This attribute implies indicates that the function musttail calls another function and returns whatever it returns. The return type of the thunk is meaningless, as the thunk can dynamically call different functions with different return types. So long as the callers bitcast the thunk with the correct type, behavior is well defined. This attribute was necessary to fix PR20944, where the indirect call combiner noticed that the thunk returned void and replaced the results of the indirect call instruction with undef. Over-the-shoulder reviewed by David Majnemer. llvm-svn: 226707
* MS ABI: Virtual member pointer thunks should be in COMDAT groupsDavid Majnemer2015-01-211-6/+8
| | | | | | | They can be emitted by multiple translation units and thus belong in a COMDAT group. llvm-svn: 226630
* Fix my broken test cases.Reid Kleckner2014-08-291-22/+2
| | | | llvm-svn: 216791
* Make all virtual member pointers use variadic musttail callsReid Kleckner2014-08-291-67/+67
| | | | | | | | | This avoids encoding information about the function prototype into the thunk at the cost of some function prototype bitcast gymnastics. Fixes PR20653. llvm-svn: 216782
* MS ABI: Virtual member pointer thunks are not unnamed_addrReid Kleckner2014-08-151-12/+14
| | | | | | They can be compared for identity. llvm-svn: 215745
* MS ABI: Use musttail for vtable thunks that pass arguments by valueReid Kleckner2014-07-261-12/+33
| | | | | | | | | | | | | This moves some memptr specific code into the generic thunk emission codepath. Fixes PR20053. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D4613 llvm-svn: 214004
* MS ABI: Use musttail for thunk IR generationReid Kleckner2014-05-151-8/+36
| | | | | | | | | | | This allows us to perfectly forward non-trivial arguments that use inalloca. We still can't forward non-trivial arguments through thunks when we have a covariant return type with a non-trivial adjustment. This would require emitting an extra copy, which is non-conforming anyway. llvm-svn: 208927
* MS ABI: Pass 'sret' as the second parameter of instance methodsReid Kleckner2014-05-091-10/+10
| | | | | | | | | | | | | | | | | Summary: MSVC always passes 'sret' after 'this', unlike GCC. This required changing a number of places in Clang that assumed the sret parameter was always first in LLVM IR. This fixes win64 MSVC ABI compatibility for methods returning structs. Reviewers: rsmith, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3618 llvm-svn: 208458
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-10/+10
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* 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
* [-cxx-abi microsoft] Emit thunks for pointers to virtual member functionsHans Wennborg2013-11-151-0/+108
Instead of storing the vtable offset directly in the function pointer and doing a branch to check for virtualness at each call site, the MS ABI generates a thunk for calling the function at a specific vtable offset, and puts that in the function pointer. This patch adds support for emitting such thunks. However, it doesn't support pointers to virtual member functions that are variadic, have an incomplete aggregate return type or parameter, or are overriding a function in a virtual base class. Differential Revision: http://llvm-reviews.chandlerc.com/D2104 llvm-svn: 194827
OpenPOWER on IntegriCloud