Rafael Espindola
8e7ca8e0b1
Don't produce a vtable for a class if we have an explicit template instantiation declaration and no key function. We will produce the vtable at the explicit template instantiation.
...
Fixes PR6748
llvm-svn: 100266
2010-04-03 04:26:42 +00:00
Rafael Espindola
c50c27cca8
the big refactoring bits of PR3782.
...
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920
2010-03-30 20:24:48 +00:00
Rafael Espindola
ff6a1fc1f3
Don't produce a vtable if we are just instantiating a method and the
...
class has no key function.
Fix PR6738.
llvm-svn: 99900
2010-03-30 18:07:27 +00:00
Anders Carlsson
f141dd1b95
Remove the old vtable layout code.
...
llvm-svn: 99869
2010-03-30 03:43:47 +00:00
Anders Carlsson
a086edc0e6
Remove UseNewVTableCode checks.
...
llvm-svn: 99868
2010-03-30 03:35:35 +00:00
Anders Carlsson
85e64359df
Flip the switch and use the new vtable layout code for everything. I've verified that this passes a self-host but I'll let the bots self host as well before removing the now dead code.
...
llvm-svn: 99861
2010-03-30 02:21:54 +00:00
Anders Carlsson
eba1a60ef0
Another vtable layout fix, making us match gcc better.
...
llvm-svn: 99812
2010-03-29 15:08:41 +00:00
Anders Carlsson
cb6207f723
Handle pure virtual member functions.
...
llvm-svn: 99807
2010-03-29 05:40:50 +00:00
Anders Carlsson
a627ac7ee6
More vtable work - it's not possible to use the new vtable code for everything by setting a flag inside CGVtable.cpp. My plan is to run some tests and bootstrap and once that's done flip the bit.
...
llvm-svn: 99804
2010-03-29 03:38:52 +00:00
Anders Carlsson
800ded68b5
Only add thunks for the most derived class. This fixes some link errors I was seeing in files generated by the vtable tester utility.
...
llvm-svn: 99801
2010-03-29 02:53:58 +00:00
Anders Carlsson
f6f24c609b
Cleanup, no functionality change.
...
llvm-svn: 99798
2010-03-29 02:08:26 +00:00
Anders Carlsson
9a97e2ef95
Add the thunks needed by this vtable.
...
llvm-svn: 99793
2010-03-29 01:38:05 +00:00
Anders Carlsson
848d86e5c4
Make sure to sort the vtable thunks by their vtable index :) With this we now pass the test from http://www.codesourcery.com/public/cxx-abi/abi-examples.html#vtable-ctor successfully.
...
llvm-svn: 99792
2010-03-29 01:28:05 +00:00
Anders Carlsson
8baeaf0a26
Two bug fixes, we weren't updating the thunk index when creating the vtable initializer and we weren't storing the secondary virtual pointer indices.
...
llvm-svn: 99786
2010-03-29 01:04:16 +00:00
Anders Carlsson
174376629a
Give thunks the same linkage as their original methods.
...
llvm-svn: 99729
2010-03-27 20:50:27 +00:00
Anders Carlsson
92d95f2f7b
Use the new vtable layout code for construction vtables.
...
llvm-svn: 99606
2010-03-26 04:13:46 +00:00
Anders Carlsson
a208b3997d
Way more VTT builder cleanup.
...
llvm-svn: 99604
2010-03-26 03:56:54 +00:00
Anders Carlsson
e67698bd73
Start cleaning up the VTT builder to make it work more like the VTable builder.
...
llvm-svn: 99581
2010-03-26 00:35:45 +00:00
Anders Carlsson
151b062fee
Don't add address points for virtual primary bases that aren't primary bases in the complete class.
...
llvm-svn: 99555
2010-03-25 21:45:14 +00:00
Anders Carlsson
a5736bde2e
Use the new vtable layout code for construction vtables.
...
llvm-svn: 99516
2010-03-25 16:49:53 +00:00
Anders Carlsson
a4147148ff
When -fdump-vtable-layouts is specified, construction vtable initializers will be generated using the new vtable layout code. (The code is still not completely in place but this is a huge step forward).
...
llvm-svn: 99508
2010-03-25 15:26:28 +00:00
Anders Carlsson
d03325c54f
More address point map shuffling.
...
llvm-svn: 99462
2010-03-25 00:51:13 +00:00
Anders Carlsson
0534b0201e
Shuffle some code around; this will make it easier to use the new layout code for address points.
...
llvm-svn: 99461
2010-03-25 00:35:49 +00:00
Anders Carlsson
e90954de64
More vtable improvements. We now compute and keep track of all vtable related information which avoids computing the same vtable layout over and over.
...
llvm-svn: 99403
2010-03-24 16:42:11 +00:00
Anders Carlsson
67fbf9853f
Use getNamedGlobal instead of getGlobalVariable. (Fixes self-host).
...
llvm-svn: 99385
2010-03-24 05:32:05 +00:00
Anders Carlsson
b35ea55e2e
More vtable work; preparations for moving over to the new vtable layout code (finally).
...
llvm-svn: 99381
2010-03-24 03:57:14 +00:00
Anders Carlsson
95e0223baf
Remove old thunks code.
...
llvm-svn: 99374
2010-03-24 00:57:54 +00:00
Anders Carlsson
68fdb871dc
Flip the switch and use the new vtable layout code for thunks by default. Add a thunks.cpp test.
...
llvm-svn: 99367
2010-03-24 00:41:37 +00:00
Anders Carlsson
bad991dbfd
Add CodeGenFunction::GenerateThunk and implement it.
...
llvm-svn: 99365
2010-03-24 00:39:18 +00:00
Anders Carlsson
4a3cdf5ac7
Minor cleanup.
...
llvm-svn: 99364
2010-03-24 00:35:44 +00:00
Rafael Espindola
fa1708fdea
revert 99311. Looks like it broke darwin bootstrap.
...
llvm-svn: 99317
2010-03-23 19:55:22 +00:00
Rafael Espindola
4d3745ade6
Avoid producing implicit methods when we have a explicit template instantiation
...
declaration.
llvm-svn: 99311
2010-03-23 18:56:16 +00:00
Anders Carlsson
55e89f877c
More work on thunks - don't assert if there's a variable with the same name as the thunk already.
...
llvm-svn: 99303
2010-03-23 18:18:41 +00:00
Anders Carlsson
cd836f0b5f
More thunks scaffolding.
...
llvm-svn: 99294
2010-03-23 17:17:29 +00:00
Anders Carlsson
5c5abad5d9
More work on thunks.
...
llvm-svn: 99287
2010-03-23 16:36:50 +00:00
Anders Carlsson
274fc82289
Move ThunkInfo as well.
...
llvm-svn: 99280
2010-03-23 15:17:13 +00:00
Anders Carlsson
67fd3a50dc
Move ReturnAdjustment and ThisAdjustment out into CGVtable.h
...
llvm-svn: 99279
2010-03-23 15:13:06 +00:00
Anders Carlsson
917229cf75
Baby steps towards making thunks be emitted from the new vtable layout code.
...
llvm-svn: 99254
2010-03-23 04:59:02 +00:00
Anders Carlsson
7cea12ff9b
Some renames.
...
llvm-svn: 99253
2010-03-23 04:44:10 +00:00
Anders Carlsson
af82f63b47
Always emit associated thunks when emitting the function itself. Remove getVtableAddressPoint, it's not used.
...
llvm-svn: 99252
2010-03-23 04:31:31 +00:00
Anders Carlsson
8841024a7c
Rename MaybeEmitVtable to EmitVTableRelatedData in preparation for making it emit thunks as well.
...
llvm-svn: 99251
2010-03-23 04:15:00 +00:00
Anders Carlsson
a864caff8c
Rename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo class.
...
llvm-svn: 99250
2010-03-23 04:11:45 +00:00
Anders Carlsson
290c6ed7c7
More work on thunks; almost there now.
...
llvm-svn: 99199
2010-03-22 20:06:40 +00:00
Anders Carlsson
7eb99a607d
Add less than operators to ThisAdjustment, ReturnAdjustment and ThunkInfo. Sort the thunks before dumping them.
...
llvm-svn: 99184
2010-03-22 16:30:44 +00:00
Anders Carlsson
53a47bf901
Improve dumping of thunks.
...
llvm-svn: 99181
2010-03-22 16:10:59 +00:00
Anders Carlsson
64decd3586
We want to add all thunks, not just 'this' adjustment thunks.
...
llvm-svn: 99177
2010-03-22 15:47:01 +00:00
Anders Carlsson
4b2411e9d2
AddThunk should take a const reference.
...
llvm-svn: 99140
2010-03-21 20:27:14 +00:00
Anders Carlsson
18c582d9c8
When dumping vtables, also dump the thunks.
...
llvm-svn: 98799
2010-03-18 02:44:19 +00:00
Anders Carlsson
56446146fd
More work on thunks.
...
llvm-svn: 98765
2010-03-17 20:06:32 +00:00
Anders Carlsson
5d3b901e48
More this adjustment simplification.
...
llvm-svn: 98333
2010-03-12 05:28:07 +00:00