summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-thunks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-38/+38
| | | | | | | 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-4/+4
| | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | 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-4/+4
| | | | | | | | | 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
* CodeGen: Assign an appropriate comdat to thunks.Peter Collingbourne2015-06-301-2/+2
| | | | | | | | | | | | Previously we were not assigning a comdat to thunks in the Microsoft ABI, which would have required us to emit these functions outside of a comdat. (Due to an inconsistency in how we were emitting objects, we were getting this right most of the time, but only when compiling with function sections.) This code generator change causes us to create a comdat for each thunk. Differential Revision: http://reviews.llvm.org/D10829 llvm-svn: 241102
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-6/+6
| | | | llvm-svn: 230783
* Add comdat to thunks.Rafael Espindola2015-01-191-3/+3
| | | | llvm-svn: 226465
* Make this test a bit stricter. NFC.Rafael Espindola2015-01-191-6/+6
| | | | llvm-svn: 226463
* MS ABI: Properly call global delete when invoking virtual destructorsDavid Majnemer2014-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The Itanium ABI approach of using offset-to-top isn't possible with the MS ABI, it doesn't have that kind of information lying around. Instead, we do the following: - Call the virtual deleting destructor with the "don't delete the object flag" set. The virtual deleting destructor will return a pointer to 'this' adjusted to the most derived class. - Call the global delete using the adjusted 'this' pointer. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5996 llvm-svn: 220993
* MS ABI: Emit more canonical vbptr stores and loadsReid Kleckner2014-10-221-4/+3
| | | | | | | | This eliminates some i8* GEPs and makes the IR that clang emits a bit more canonical. More work is needed for vftables, but that isn't a clear win so I plan to send it for review. llvm-svn: 220398
* MS ABI: Update the thunk linkage computationHans Wennborg2014-06-061-4/+15
| | | | | | | | | | | | | | | | | | | | | | | As suggested by Reid: - class has GVA_Internal linkage -> internal - thunk has return adjustment -> weak_odr, to handle evil corner case [1] - all other normal methods -> linkonce_odr 1. Evil corner case: struct Incomplete; struct A { int a; virtual A *bar(); }; struct B { int b; virtual B *foo(Incomplete); }; struct C : A, B { int c; virtual C *foo(Incomplete); }; C c; Here, the thunk for C::foo() will be emitted when C::foo() is defined, which might be in a different translation unit, so it needs to be weak_odr. Differential Revision: http://reviews.llvm.org/D3992 llvm-svn: 210368
* 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
* Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoftTimur Iskhodzhanov2013-11-061-2/+0
| | | | llvm-svn: 194132
* Make thunk this/return adjustment ABI-specific. Also, fix the return ↵Timur Iskhodzhanov2013-10-301-7/+30
| | | | | | | | adjustment when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D2026 llvm-svn: 193679
* Use castAs instead of cast in thunk generationReid Kleckner2013-10-111-0/+15
| | | | | | | | Calling convention attributes can add sugar to methods that we have to look through. This fixes an assertion failure in the provided test case. llvm-svn: 192496
* Reland 192220 "Abstract out parts of thunk emission code, add support for ↵Timur Iskhodzhanov2013-10-091-0/+118
| | | | | | simple thunks when using -cxx-abi microsoft" with relaxed assertions llvm-svn: 192285
* Revert 192220 as it fails on an assertionTimur Iskhodzhanov2013-10-081-118/+0
| | | | llvm-svn: 192225
* Abstract out parts of thunk emission code, add support for simple thunks ↵Timur Iskhodzhanov2013-10-081-0/+118
when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1787 llvm-svn: 192220
OpenPOWER on IntegriCloud