Commit Graph

134 Commits

Author SHA1 Message Date
Mike Stump d538a6d364 Remove some dead code.
llvm-svn: 92123
2009-12-24 07:29:41 +00:00
Anders Carlsson 3f4336cb1f Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway.
llvm-svn: 91590
2009-12-17 07:09:17 +00:00
Eli Friedman 2151725325 Fix a small bug in ComputeMethodVtableIndices.
llvm-svn: 91411
2009-12-15 03:31:17 +00:00
Eli Friedman 3ace52b3a7 Fix linkage of type info and vtable for classes without linkage.
llvm-svn: 91152
2009-12-11 20:48:18 +00:00
Anders Carlsson fd7dfeb779 Improve linkage of RTTI data structures. Introduce CodeGenModule::GetAddrOfRTTI which figures out the right linkage of the RTTI information for the given type and whether it should be defined or not. I will migrate clients over to GetAddrOfRTTI in subsequent commits (with tests).
llvm-svn: 91098
2009-12-11 02:46:30 +00:00
Eli Friedman 48c6b0d14f Slight tweak to vtable linkage.
llvm-svn: 90832
2009-12-08 04:09:14 +00:00
Eli Friedman 31bc3ad275 A bunch more thunk fixes from misc testing.
(Yes, I do intend to commit some tests for this.)

llvm-svn: 90818
2009-12-07 23:56:34 +00:00
Anders Carlsson e1b3e6292a It's OK to try to emit a vtable definition more than once. Fixes PR5697.
llvm-svn: 90751
2009-12-07 07:59:52 +00:00
Eli Friedman c0dacee1e0 Erm, revert for the moment; I didn't test this as thoroughly as I should have
(although it does pass regression tests).

llvm-svn: 90747
2009-12-07 04:45:50 +00:00
Eli Friedman c5d3a6ae3d Tweak the formula for non-virtual offsets to something which appears a bit
more accurate.

llvm-svn: 90746
2009-12-07 04:38:34 +00:00
Anders Carlsson 5ebf8b44e9 Move key functions to a separate map.
llvm-svn: 90745
2009-12-07 04:35:11 +00:00
Eli Friedman f2eda5efd2 Be a bit more complete about accumulating SavedThisAdjustments.
llvm-svn: 90723
2009-12-06 22:33:51 +00:00
Eli Friedman 8174f2c23c Work-in-progess rewrite of thunks: move thunk generation outside of vtable
generation, and make sure we generate thunks when the function is defined
rather than when the vtable is defined.

llvm-svn: 90722
2009-12-06 22:01:30 +00:00
Anders Carlsson fe5f7d916f Set the correct linkage for VTTs as well.
llvm-svn: 90689
2009-12-06 01:09:21 +00:00
Anders Carlsson 232324c5c0 More linkage improvements.
llvm-svn: 90687
2009-12-06 00:53:22 +00:00
Anders Carlsson 0911ae8ef2 Pass the desired vtable linkage to GenerateVtable directly. Only call MaybeMarkVirtualImplicitMembersReferenced for non-inline functions.
llvm-svn: 90686
2009-12-06 00:23:49 +00:00
Anders Carlsson 7e28c5f2e2 Make GenerateVtable a private member function of CGVtableInfo.
llvm-svn: 90684
2009-12-06 00:01:05 +00:00
Anders Carlsson 4ed44eb7d9 Only emit the vtable definition if the class has a key function and we're emitting it, or if the class doesn't have a key function and we are emitting the complete constructor.
llvm-svn: 90681
2009-12-05 22:42:54 +00:00
Anders Carlsson 0ab79e22ab If a class does not have a key function, its linkage should be weak_odr.
llvm-svn: 90680
2009-12-05 22:24:38 +00:00
Anders Carlsson 58b271d450 Use createGlobalVariable for creating vtable variables too.
llvm-svn: 90679
2009-12-05 22:19:10 +00:00
Anders Carlsson b3f54b748d CodeGenModule::GenerateVtable now returns a pointer directly to the vtable and not to the address point.
llvm-svn: 90676
2009-12-05 21:28:12 +00:00
Anders Carlsson a95d4c51dc Make sure that hte vtable always has an i8* array type.
llvm-svn: 90675
2009-12-05 21:09:05 +00:00
Anders Carlsson c8e39ec79f Add a function for getting the vtable address point of a class.
llvm-svn: 90674
2009-12-05 21:03:56 +00:00
Anders Carlsson b694f05ffb Simplify BuildVTT.
llvm-svn: 90673
2009-12-05 21:02:25 +00:00
Anders Carlsson b78d093fcc Let the VTT builder pretend that getVtable returns a pointer to the vtable and not to the vtable address point.
llvm-svn: 90672
2009-12-05 20:58:49 +00:00
Anders Carlsson 78c2898e02 Change getCtorVtable to not return the address point offset, but the global variable.
llvm-svn: 90671
2009-12-05 20:42:53 +00:00
Anders Carlsson 21bbc1e705 Factor vtable related GlobalVariable creation out into a separate function. Add vtable linkage test.
llvm-svn: 90667
2009-12-05 17:04:47 +00:00
Eli Friedman 6c08ce7706 Skip actually generating the vtable unless we are defining it. This avoids
the side-effects of generating the methods in the vtable (including PR5676).

llvm-svn: 90635
2009-12-05 01:05:03 +00:00
Benjamin Kramer 62ab616666 Return bool as a bool instead of a uint64_t.
llvm-svn: 90610
2009-12-04 22:45:27 +00:00
Anders Carlsson bad80eb792 Rename 'Class' to 'MostDerivedClass'
llvm-svn: 90573
2009-12-04 18:36:22 +00:00
Anders Carlsson 19462d681a Store the vtable components in a SmallVector.
llvm-svn: 90571
2009-12-04 16:24:46 +00:00
Anders Carlsson 4e1d75f3ed Use a different ConstantArray::get.
llvm-svn: 90570
2009-12-04 16:22:27 +00:00
Anders Carlsson 472404f8a6 Move the vtable vector directly into the Vtable builder.
llvm-svn: 90569
2009-12-04 16:19:30 +00:00
Anders Carlsson 7bb7076b51 Change getIndex to return false if the index wasn't found. Avoids an extra hash lookup.
llvm-svn: 90568
2009-12-04 15:49:02 +00:00
Eli Friedman 65d87222b2 Minor cleanup; no functionality change.
llvm-svn: 90565
2009-12-04 08:52:11 +00:00
Eli Friedman 81fb0d2656 Remove unused argument.
llvm-svn: 90563
2009-12-04 08:40:51 +00:00
Eli Friedman c07aebee90 Eliminate submethods vector.
llvm-svn: 90562
2009-12-04 08:36:58 +00:00
Eli Friedman 3d2e9de337 Eliminate the inner loop in VtableBuilder::OverrideMethod.
llvm-svn: 90561
2009-12-04 08:34:14 +00:00
Anders Carlsson f3935b4d4b Make sure that overridden method decls are always canonical.
llvm-svn: 90542
2009-12-04 05:51:56 +00:00
Eli Friedman 94bc2dade6 Fix regression in vtable improvements.
llvm-svn: 90540
2009-12-04 04:30:03 +00:00
Eli Friedman b05eb963e0 Rename method to something easier to search for.
llvm-svn: 90536
2009-12-04 03:54:56 +00:00
Anders Carlsson a93e980fbc More work in preparation of getting rid of the submethods loop.
llvm-svn: 90535
2009-12-04 03:52:52 +00:00
Anders Carlsson f2f31f4371 Remove an unused member variable.
llvm-svn: 90534
2009-12-04 03:46:21 +00:00
Anders Carlsson e609636e0d Add a way to get the index of a method. Assert that we have the same index for now.
llvm-svn: 90533
2009-12-04 03:41:37 +00:00
Anders Carlsson b07567c315 Add a premature optimization.
llvm-svn: 90532
2009-12-04 03:07:26 +00:00
Anders Carlsson 50f147460a Add the method directly to the vtable.
llvm-svn: 90531
2009-12-04 03:06:03 +00:00
Anders Carlsson 79bce40365 Get rid of the PureVirtualMethods map.
llvm-svn: 90530
2009-12-04 02:58:12 +00:00
Anders Carlsson ddf42c8d80 Move handling of pure virtual methods to AppendMethods (and rename it to AppendMethodsToVtable).
llvm-svn: 90529
2009-12-04 02:56:03 +00:00
Anders Carlsson 5b3ea9bf1c Move covariant thunk handling to AppendMethods too.
llvm-svn: 90528
2009-12-04 02:52:22 +00:00
Anders Carlsson 86809cd8ab Move 'this' pointer adjustment thunks to AppendMethods.
llvm-svn: 90527
2009-12-04 02:43:50 +00:00