309 Commits

Author SHA1 Message Date
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
Anders Carlsson
3c289673d6 Remove OldOffset.
llvm-svn: 98331
2010-03-12 05:02:01 +00:00
Anders Carlsson
2b2b8f1949 Remove debug output.
llvm-svn: 98330
2010-03-12 04:55:20 +00:00
Anders Carlsson
8a2402989d Begin simplifying handling of thunks.
llvm-svn: 98329
2010-03-12 04:54:20 +00:00
Anders Carlsson
dd819c981f Use the new vtable layout code for computing virtual base offset offsets.
llvm-svn: 98257
2010-03-11 16:06:20 +00:00
Anders Carlsson
4cbe83cccb Rename getVirtualBaseOffsetIndex to getVirtualBaseOffsetOffset to reflect what it actually does.
llvm-svn: 98248
2010-03-11 07:15:17 +00:00
Anders Carlsson
e4424888e4 When possible, use the vbase offset offsets from the most derived class directly.
llvm-svn: 98247
2010-03-11 07:00:45 +00:00
Anders Carlsson
7f6b71e222 Keep track of, and dump, vbase offset offsets.
llvm-svn: 98245
2010-03-11 06:43:12 +00:00
Anders Carlsson
9f28dbc53a Fix tests.
llvm-svn: 98242
2010-03-11 06:10:52 +00:00
Anders Carlsson
d5531e2d18 Run the new vtable builder for construction vtables as well now. Note that we still don't use the data it generates.
llvm-svn: 98239
2010-03-11 05:48:21 +00:00
Anders Carlsson
423406f335 Fix calculation of whether a member function needs a thunk in construction vtables.
llvm-svn: 98191
2010-03-10 21:25:37 +00:00
Anders Carlsson
115b4756b5 We were mistakenly marking morally virtual bases as being uninteresting. Fix this.
llvm-svn: 98180
2010-03-10 19:39:11 +00:00
Anders Carlsson
703a08605f Ignore non-interesting bases when emitting construction vtables.
llvm-svn: 98177
2010-03-10 19:15:26 +00:00
Anders Carlsson
804cf51dcf Don't accidentally mark some functions in construction vtables as unused. Also land the test for a previous checkin, now that it's correct.
llvm-svn: 98139
2010-03-10 06:51:42 +00:00
Anders Carlsson
02b99d6b7c When building construction vtables, we need to check if a primary virtual base is actually a primary virtual base in the layout class.
llvm-svn: 98131
2010-03-10 03:02:01 +00:00
Anders Carlsson
ca82a4fdba Improve vcall offset handling in construction vtables. With this we layout the construction vtables from the ABI examples correctly.
llvm-svn: 98127
2010-03-10 02:33:41 +00:00
Rafael Espindola
e7113ca907 Delay codegen of vtables when handling implicit instantiations.
This fixes PR6474.

llvm-svn: 98123
2010-03-10 02:19:29 +00:00
Anders Carlsson
5b0057c05b Fix a bug with base offset merging that Devang noticed.
llvm-svn: 97641
2010-03-03 04:58:02 +00:00
Anders Carlsson
93b1b49082 Simplify code.
llvm-svn: 97551
2010-03-02 05:40:45 +00:00