Timur Iskhodzhanov
5877663622
Fix vbtable indices when a class shares the vbptr with a non-virtual base
...
llvm-svn: 194082
2013-11-05 15:54:58 +00:00
Timur Iskhodzhanov
0201432a5e
Make thunk this/return adjustment ABI-specific. Also, fix the return adjustment when using -cxx-abi microsoft
...
Reviewed at http://llvm-reviews.chandlerc.com/D2026
llvm-svn: 193679
2013-10-30 11:55:43 +00:00
Timur Iskhodzhanov
66f4381b39
Fix an assertion when handling a custom case of virtual inheritance; also reduce code duplication
...
llvm-svn: 193610
2013-10-29 14:13:45 +00:00
Timur Iskhodzhanov
8b14242fe5
Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
...
llvm-svn: 193164
2013-10-22 14:50:20 +00:00
Timur Iskhodzhanov
62082b7e0b
[-cxx-abi microsoft] Fix this argument/parameter offsets for virtual destructors in the presence of virtual bases
...
Reviewed at http://llvm-reviews.chandlerc.com/D1939
llvm-svn: 192822
2013-10-16 18:24:06 +00:00
Benjamin Kramer
9f8e2d77c1
Reduce double set lookups by using the result of insert.
...
No functionality change.
llvm-svn: 192598
2013-10-14 15:16:10 +00:00
Timur Iskhodzhanov
e1ebc5fb66
Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumVTableBuilder and clang-format code around
...
llvm-svn: 192288
2013-10-09 11:33:51 +00:00
Timur Iskhodzhanov
ad9d3b8fd1
Reland 192220 "Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft" with relaxed assertions
...
llvm-svn: 192285
2013-10-09 09:23:58 +00:00
Timur Iskhodzhanov
c7113073dd
Revert 192220 as it fails on an assertion
...
llvm-svn: 192225
2013-10-08 20:09:50 +00:00
Timur Iskhodzhanov
1ffb3916ce
Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft
...
Reviewed at http://llvm-reviews.chandlerc.com/D1787
llvm-svn: 192220
2013-10-08 19:15:38 +00:00
Timur Iskhodzhanov
20df98c0d0
Fix PR17382 - properly group virtual method overloads in the vftable
...
llvm-svn: 192067
2013-10-06 15:31:37 +00:00
Timur Iskhodzhanov
8b5987eba5
Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft
...
Reviewed at http://llvm-reviews.chandlerc.com/D1532
llvm-svn: 191523
2013-09-27 14:48:01 +00:00
Timur Iskhodzhanov
88fd439a24
Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft
...
llvm-svn: 188870
2013-08-21 06:25:03 +00:00
Benjamin Kramer
dca8abde77
Make helper function static.
...
llvm-svn: 187574
2013-08-01 11:08:06 +00:00
Timur Iskhodzhanov
df7e7fb642
Add MicrosoftVFTableContext to AST
...
llvm-svn: 187409
2013-07-30 09:46:19 +00:00
Craig Topper
5603df45df
Use SmallVectorImpl& for function arguments instead of SmallVector.
...
llvm-svn: 185715
2013-07-05 19:34:19 +00:00
Timur Iskhodzhanov
7f55a455d1
Simplify getting CXXRecordDecl from a base iterator
...
llvm-svn: 185438
2013-07-02 16:00:40 +00:00
Timur Iskhodzhanov
1151031eb7
Fix a trivial typo, add a FIXME to have more test coverage for VTableBuilder
...
llvm-svn: 185159
2013-06-28 15:42:28 +00:00
Eli Friedman
b998bff32b
Delete dead code.
...
llvm-svn: 185101
2013-06-27 20:48:08 +00:00
Timur Iskhodzhanov
05e3670498
Recommit r183298+r183300 'Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers()'
...
In r183298, I've used llvm::SmallPtrSet<..., 8> instead of llvm::SmallVector<..., 8> for NewVirtualFunctionsTy by mistake.
This only manifested when a class had more than 8 virtual functions, which wasn't covered by unit-tests
llvm-svn: 183310
2013-06-05 14:05:50 +00:00
Timur Iskhodzhanov
b640dd6f43
Revert r183298 and r183300 as the former broke the virtual function lookup in libcxx __locale
...
llvm-svn: 183305
2013-06-05 12:24:46 +00:00
David Blaikie
d620e9da74
Fix fallout from r183298, unused function (CollectPrimaryBases) causing the -Werror build to fail
...
llvm-svn: 183300
2013-06-05 06:50:40 +00:00
Timur Iskhodzhanov
be5a3d876c
Fix the DUMP_OVERRIDERS macro in the VTableBuilder.cpp
...
llvm-svn: 183299
2013-06-05 06:40:07 +00:00
Timur Iskhodzhanov
12f1f84d12
Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers(); also add some tests for the VTable indices output to make sure we don't regress
...
llvm-svn: 183298
2013-06-05 06:36:37 +00:00
Timur Iskhodzhanov
bb5a17e8fa
Fix one FIXME in VTableBuilder
...
llvm-svn: 181396
2013-05-08 08:09:21 +00:00
Timur Iskhodzhanov
ee6bc53365
Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058
...
llvm-svn: 175045
2013-02-13 08:37:51 +00:00
Benjamin Kramer
325d74566f
CodeGen: Remove unnecessary const_casts. No functionality change.
...
llvm-svn: 174292
2013-02-03 18:55:34 +00:00
John McCall
359b885e12
First pass at abstracting out a class for the target C++ ABI.
...
llvm-svn: 173514
2013-01-25 22:30:49 +00:00
Timur Iskhodzhanov
52b8a05234
First step towards vftable generation with -cxx-abi microsoft PR13231
...
llvm-svn: 173035
2013-01-21 13:02:41 +00:00
Benjamin Kramer
444a1304ad
Include pruning and general cleanup.
...
llvm-svn: 169095
2012-12-01 17:12:56 +00:00
David Blaikie
596d2cacc7
Note deleted functions when dumping vtables.
...
llvm-svn: 166056
2012-10-16 20:25:33 +00:00
Sylvestre Ledru
830885ca64
Fix a typo (the the => the)
...
llvm-svn: 160622
2012-07-23 08:59:39 +00:00
Benjamin Kramer
2ef3031496
Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used instead.
...
No functionality change.
llvm-svn: 159719
2012-07-04 18:45:14 +00:00
David Blaikie
40ed29730b
Revert Decl's iterators back to pointer value_type rather than reference value_type
...
In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.
This rolls back r155808 and r155869.
Review by Doug Gregor incorporating feedback from Chandler Carruth.
llvm-svn: 158104
2012-06-06 20:45:41 +00:00
David Blaikie
2d7c57ec1d
Remove the ref/value inconsistency in filter_decl_iterator.
...
filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.
This change errs on the side of value, making op-> return T* and op* return
T&.
(reviewed by Richard Smith)
llvm-svn: 155808
2012-04-30 02:36:29 +00:00
Benjamin Kramer
e298063669
Replace manual delete[] with OwningArrayPtr.
...
llvm-svn: 154748
2012-04-14 14:13:43 +00:00
Benjamin Kramer
1d1d2d289a
Don't leak vtable thunks.
...
llvm-svn: 154747
2012-04-14 13:21:23 +00:00
John McCall
b6c4a7ef21
For the annals of subtle but terrible bugs: fix a longstanding bug
...
in vtable layout where virtual methods inherited from virtual bases
could be assigned the same vcall adjustment slot if they shared
a name and parameter signature but differed in their
cv-qualification. The code was already trying to handle this
case, but unfortunately used the ordinary type qualifiers
(which are always empty here) instead of the method qualifiers.
This seems like something that the API should discourage, but
I don't know how to carry that principle out in this instance.
Eliminate this function's need for an ASTContext while we're at it.
This bug affects the ABI, and fixing it brings us into accord with
the Itanium ABI (and GCC's implementation of it), but, obviously,
technically breaks full compatibility with previous releases of Clang.
Just letting you know.
llvm-svn: 153168
2012-03-21 06:57:19 +00:00
David Blaikie
bbafb8a745
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
...
The member variable is always "LangOpts" and the member function is always "getLangOpts".
Reviewed by Chris Lattner
llvm-svn: 152536
2012-03-11 07:00:24 +00:00
Benjamin Kramer
5291e68c0c
Fix a use of the C99 PRI format macros not to conflict with C++11 UDLs.
...
llvm-svn: 152475
2012-03-10 02:06:27 +00:00
Benjamin Kramer
867e40135a
Make format string 64 bit safe.
...
llvm-svn: 143870
2011-11-06 09:34:11 +00:00
John McCall
f937c023bf
Rename TagDecl::isDefinition -> isCompleteDefinition
...
for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355
2011-10-07 06:10:15 +00:00
Peter Collingbourne
cfd2356180
Move VTable builder to AST
...
llvm-svn: 140510
2011-09-26 01:57:12 +00:00