summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-56/+56
| | | | | | | 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-1/+1
| | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | 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-1/+1
| | | | | | | | | 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: New vtable group representation: struct of vtable arrays.Peter Collingbourne2016-12-131-8/+8
| | | | | | | | | In a future change, this representation will allow us to use the new inrange annotation on getelementptr to allow the optimizer to split vtable groups. Differential Revision: https://reviews.llvm.org/D22296 llvm-svn: 289584
* [MS ABI] Fix a crash in vptr path calculationDavid Majnemer2015-05-041-1/+1
| | | | | | | | | | | | | I discovered a case where the old algorithm would crash. Instead of trying to patch the algorithm, rewrite it. The new algorithm operates in three phases: 1. Find all paths to the subobject with the vptr. 2. Remove paths which are subsets of other paths. 3. Select the best path where 'best' is defined as introducing the most covariant overriders. If two paths introduce different overriders, raise a diagnostic. llvm-svn: 236444
* [MS ABI] NV bases may indirectly contain covariant thunks from V BasesDavid Majnemer2015-05-011-2/+2
| | | | | | | | | | | | A class might contain multiple ways of getting to a vbase, some of which are virtual and other non-virtual. It may be the case that a non-virtual base contains an override of a method in a vbase. This means that we must carefully pick between a set of nvbases to determine which is the best. As a consequence, the findPathForVPtr algorithm is considerably simpler. llvm-svn: 236353
* [MS ABI] Correctly make paths through covariant virtual basesDavid Majnemer2015-04-301-1/+1
| | | | | | | | | | | | There can be multiple virtual bases which are on the path to a vfptr when one vbase virtually inherits from another. We should prefer the most derived virtual base which covariantly overrides a method in the vfptr class; if we do not lengthen the path this way, we will end up with too few vftable entries. This fixes PR21073. llvm-svn: 236239
* [MS ABI] Use 'continue' instead of 'return false' where intendedReid Kleckner2015-04-271-0/+38
| | | | | | | | | | | | This was a bug in r218285 that prevented us from seeing subsequent virtual bases in the class hierarchy, leading to crashes later. Also add some comments to this function, now that we better understand what it's trying to do. Fixes PR21062 and PR21064. llvm-svn: 235899
* MS ABI: Move test from virtual-inheritance to single-inheritanceDavid Majnemer2014-10-031-13/+1
| | | | | | The test didn't actually use virtual inheritance. llvm-svn: 218966
* MS ABI: Add a vftable test for pure virtual methodsDavid Majnemer2014-10-031-0/+10
| | | | llvm-svn: 218965
* MS ABI: Clean up test to not use dllexport, check vftable entriesDavid Majnemer2014-10-031-1/+5
| | | | llvm-svn: 218964
* Fix a vftable mangling bugReid Kleckner2014-09-221-6/+39
| | | | | | | | | | | | | We need to walk the class hierarchy twice: once in depth-first base specifier order for mangling and again in depth-first layout order for vftable layout. Vftable layout seems to depend on the full path from the most derived class to the base containing the vfptr. Fixes PR21031. llvm-svn: 218285
* MS ABI: The latest VC "14" CTP implements deleted virtual functionsDavid Majnemer2014-09-121-1/+9
| | | | | | | | | | | | Deleted virtual functions get _purecall inserted into the vftable. Earlier CTPs would simply stick nullptr in there. N.B. MSVC can't handle deleted virtual functions which require return adjusting thunks, they give an error that a deleted function couldn't be called inside of a compiler generated function. We get this correct by making the thunk have a __purecall entry as well. llvm-svn: 217654
* Fix PR20479 -- missing vftable slots in case of virtual inheritance vs ↵Timur Iskhodzhanov2014-08-091-6/+6
| | | | | | | | return adjusting thunks Reviewed at http://reviews.llvm.org/D4829 llvm-svn: 215285
* MS ABI: Update the thunk linkage computationHans Wennborg2014-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Follow-up to r206457 -- fix static adjustments for some subtle virtual ↵Timur Iskhodzhanov2014-04-171-0/+67
| | | | | | | | inheritance cases Reviewed at http://reviews.llvm.org/D3410 llvm-svn: 206504
* Fix PR19066 - 0-sized vftable in the presence of virtual inheritanceTimur Iskhodzhanov2014-03-261-0/+15
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3181 llvm-svn: 204786
* MS ABI: Mark direct virtual bases as visted when building vtable pathsReid Kleckner2014-03-251-0/+23
| | | | | | Fixes PR19240. In retrospect, this is a fairly obvious bug. :) llvm-svn: 204744
* Simplify test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp by ↵Timur Iskhodzhanov2014-03-231-253/+250
| | | | | | | | forcing VFTableBuilder invocation with virtual function calls or constructors codegen Previously the vftables were built at the end of the TU in a reverse-to-random order llvm-svn: 204567
* Fix PR19172 - wrong this adjustment calculated for virtual destructor in a ↵Timur Iskhodzhanov2014-03-201-0/+25
| | | | | | | | class with complex inheritance Reviewed at http://llvm-reviews.chandlerc.com/D3128 llvm-svn: 204394
* Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual ↵Timur Iskhodzhanov2014-03-071-8/+43
| | | | | | inheritance hierarchy llvm-svn: 203222
* Style fix: replace "1 entries" with "1 entry" in the vftable layout dumping codeTimur Iskhodzhanov2014-03-051-28/+28
| | | | llvm-svn: 202978
* MS ABI: Fix vftable mangling by using the vbtable name algorithmReid Kleckner2014-02-271-17/+26
| | | | | | | | | | | | | | | | | | Summary: This merges VFPtrInfo and VBTableInfo into VPtrInfo, since they hold almost the same information. With that change, the vbtable mangling code can easily be applied to vftable data and we magically get the correct, unambiguous vftable names. Fixes PR17748. Reviewers: timurrrr, majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2893 llvm-svn: 202425
* 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
* Add a test case for the PR17748 crashTimur Iskhodzhanov2013-12-121-0/+20
| | | | llvm-svn: 197143
* Make -fdump-vtable-layouts print to stdout, not stderrReid Kleckner2013-11-081-2/+2
| | | | | | | | | | | | | This makes it consistent with -fdump-record-layouts, which was moved to outs() in r186219. My reasoning for going with stdout is that when one of these options is present, the layouts are really a program output, and shouldn't be interleaved with diagnostics, which are on stderr. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D2127 llvm-svn: 194279
* Make thunk this/return adjustment ABI-specific. Also, fix the return ↵Timur Iskhodzhanov2013-10-301-8/+27
| | | | | | | | adjustment when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D2026 llvm-svn: 193679
* Fix an assertion when handling a custom case of virtual inheritance; also ↵Timur Iskhodzhanov2013-10-291-9/+25
| | | | | | reduce code duplication llvm-svn: 193610
* Add a missing lit-test expectation (forgotten to write initially?)Timur Iskhodzhanov2013-10-291-0/+1
| | | | llvm-svn: 193608
* [-cxx-abi microsoft] Fix this argument/parameter offsets for virtual ↵Timur Iskhodzhanov2013-10-161-0/+85
| | | | | | | | destructors in the presence of virtual bases Reviewed at http://llvm-reviews.chandlerc.com/D1939 llvm-svn: 192822
* Remove a workaround for PR16406 from the vtables-virtual-inheritance testTimur Iskhodzhanov2013-10-161-11/+8
| | | | llvm-svn: 192786
* Reland 192220 "Abstract out parts of thunk emission code, add support for ↵Timur Iskhodzhanov2013-10-091-0/+3
| | | | | | simple thunks when using -cxx-abi microsoft" with relaxed assertions llvm-svn: 192285
* Revert 192220 as it fails on an assertionTimur Iskhodzhanov2013-10-081-3/+0
| | | | llvm-svn: 192225
* Abstract out parts of thunk emission code, add support for simple thunks ↵Timur Iskhodzhanov2013-10-081-0/+3
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1787 llvm-svn: 192220
* Abstract out the emission of vtables, add basic support for vtable emission ↵Timur Iskhodzhanov2013-09-271-2/+65
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1532 llvm-svn: 191523
* Add MicrosoftVFTableContext to ASTTimur Iskhodzhanov2013-07-301-0/+391
llvm-svn: 187409
OpenPOWER on IntegriCloud