125 Commits

Author SHA1 Message Date
Mike Stump
e2d4a2c3a8 Add support for thunking dtors. Oh why does this make my head hurt?
llvm-svn: 90409
2009-12-03 03:47:56 +00:00
Anders Carlsson
dabfa3cd8b Revert r90402 for now, virt.cpp is failing.
llvm-svn: 90406
2009-12-03 03:28:24 +00:00
Anders Carlsson
e692f7c309 Use Eli's ComputeThunkAdjustment for calculating the return adjustment.
llvm-svn: 90402
2009-12-03 03:15:31 +00:00
Anders Carlsson
80bc5d5d04 Remove the index from the Thunk struct.
llvm-svn: 90400
2009-12-03 02:41:55 +00:00
Anders Carlsson
29a1f751b3 Change the Thunks map to use the vtable index as the key.
llvm-svn: 90399
2009-12-03 02:39:59 +00:00
Anders Carlsson
0e1e7632bc Add the global decl to the Thunk struct.
llvm-svn: 90398
2009-12-03 02:36:40 +00:00
Anders Carlsson
9f98f7a9e5 Remove unused struct fields.
llvm-svn: 90397
2009-12-03 02:34:59 +00:00
Anders Carlsson
657f139abe Delay computing the return adjustments for covariant thunks until when they are added to the vtable.
llvm-svn: 90396
2009-12-03 02:32:59 +00:00
Anders Carlsson
2ca285fc5c No need to create the covariant thunk in both places now.
llvm-svn: 90394
2009-12-03 02:22:59 +00:00
Anders Carlsson
1157e8fc68 Whoops, forgot to save :)
llvm-svn: 90393
2009-12-03 02:20:26 +00:00
Anders Carlsson
06c14b6f65 Remove the index field from the CovariantThunk structure.
llvm-svn: 90392
2009-12-03 02:16:14 +00:00
Anders Carlsson
73295f96c5 Change the CovariantThunk map to use the vtable index as its key.
llvm-svn: 90391
2009-12-03 02:12:03 +00:00
Anders Carlsson
c38b40a709 Store a GlobalDecl in the return adjustment.
llvm-svn: 90387
2009-12-03 02:03:29 +00:00
Anders Carlsson
2bd3c0fa34 Do not include the 'this' pointer adjustment in the covariant return type. Instead, store it in the (now oddly named) Thunks map.
llvm-svn: 90386
2009-12-03 01:58:20 +00:00
Anders Carlsson
ca1bf68cfb Move VtableBuilder::OverrideMethod out of line in preparation of other changes to it. No functionality change.
llvm-svn: 90382
2009-12-03 01:54:02 +00:00
Mike Stump
8a96d3a355 Turn off for now.
llvm-svn: 90339
2009-12-02 19:50:41 +00:00
Mike Stump
ae1b85d984 Put the Builder classes into the anonymous namespace.
llvm-svn: 90335
2009-12-02 19:07:44 +00:00
Mike Stump
c01c2b87e8 Change rtti/Rtti to RTTI, as it is an acronym.
llvm-svn: 90334
2009-12-02 18:57:08 +00:00
Anders Carlsson
b1d3f7c909 Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.
llvm-svn: 90168
2009-11-30 23:41:22 +00:00
Anders Carlsson
c920fa2a74 Fix an assert.
llvm-svn: 90149
2009-11-30 19:43:26 +00:00
Eli Friedman
03aa2f1262 Minor cleanup (no functionality change).
llvm-svn: 90105
2009-11-30 01:19:33 +00:00
Benjamin Kramer
337e3a5fea Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
llvm-svn: 90044
2009-11-28 19:45:26 +00:00
Anders Carlsson
548cc9d143 We always want to create a virtual function pointer entry if the path from the derived return value to the base overridden return value contains a virtual base class.
llvm-svn: 90024
2009-11-28 03:03:52 +00:00
Anders Carlsson
d598850203 Move the vtable builder to an anonymous namespace.
llvm-svn: 90021
2009-11-27 22:21:51 +00:00
Anders Carlsson
f942ee0297 Don't build the entire vtable when all we want is the index of a virtual method.
llvm-svn: 90017
2009-11-27 20:47:55 +00:00
Anders Carlsson
323bb04ef4 Lazily create the __cxa_pure_virtual reference.
llvm-svn: 89965
2009-11-26 19:54:33 +00:00
Anders Carlsson
d420a31fe9 Use the new CovariantThunkAdjustment in the vtable builder.
Make the pure virtual methods map a set instead.

llvm-svn: 89961
2009-11-26 19:32:45 +00:00
Anders Carlsson
6d771bcd09 Add a Thunk struct to the vtable builder.
llvm-svn: 89935
2009-11-26 03:25:13 +00:00
Anders Carlsson
2f87c4f1a5 Add a CovariantThunkAdjustment struct that represents the adjustments needed for a covariant thunk.
llvm-svn: 89933
2009-11-26 03:09:37 +00:00
Anders Carlsson
c778540f9a Add a ThunkAdjustment struct which holds a non-virtual and a virtual adjustment offset. Start using it. General cleanup in Mangle.cpp.
llvm-svn: 89925
2009-11-26 02:32:05 +00:00
Anders Carlsson
6445773279 It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.
Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".

llvm-svn: 89736
2009-11-24 05:08:52 +00:00
Daniel Dunbar
e128dd18ab IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
instead of requiring clients to make a raw_svector_ostream, which is just an
implementation detail.

llvm-svn: 89548
2009-11-21 09:06:22 +00:00
Daniel Dunbar
ef5d75afeb Sink free mangle* methods into MangleContext.
llvm-svn: 89547
2009-11-21 09:06:10 +00:00
Mike Stump
cd2b821241 Fixup address point computations. WIP.
llvm-svn: 89386
2009-11-19 20:52:19 +00:00
Mike Stump
aa51ad6815 Refine vtable, rtti and rtti name instantiation so that they follow
the key function.  All the code is wired up, but won't work yet, as I
had to turn off key function calculation as it doesn't work yet.

Also, we refine visibility of the vtable, rtti and rtti name to match
the class, as well as as arrange for all the symbols to be internal
for anonymous namespace entities.

llvm-svn: 89309
2009-11-19 04:04:36 +00:00
Mike Stump
1a139f8fb5 Improve instantiation control for rtti data and allow key functions to
instantiate a class.  WIP.

llvm-svn: 89289
2009-11-19 01:08:19 +00:00
Mike Stump
1960b20403 Refine linkage on thunks. WIP.
llvm-svn: 89287
2009-11-19 00:49:05 +00:00
Mike Stump
c0f632d6b2 Set up vtable visibility appropriately.
llvm-svn: 89193
2009-11-18 04:00:48 +00:00
Mike Stump
f5b2869b75 Finisgh off rest of class_type_info rtti generation.
llvm-svn: 88823
2009-11-14 23:32:21 +00:00
Mike Stump
c5a332cefb Handle descructor printing better.
llvm-svn: 88723
2009-11-13 23:45:53 +00:00
Mike Stump
559387fe8b Also track address points for primaries bases.
llvm-svn: 88717
2009-11-13 23:13:20 +00:00
Anders Carlsson
fb4dda4fed Instead of storing CXXMethodDecls in the vtable builder, store GlobalDecls so we can represent both the complete and deleting destructors. Also, when encountering a destructor decl, emit entries for both the complete and deleting destructors. Mike, please review.
With this change, FileCheck builds and runs the clang test suite without failures!

llvm-svn: 88663
2009-11-13 17:08:56 +00:00
Zhongxing Xu
1721ef7a53 Include header for printf.
llvm-svn: 87086
2009-11-13 05:46:16 +00:00
Mike Stump
fa81808a11 Refine construction vtables; they don't include bits that don't have
virtual bases unless they are morally virtual.

llvm-svn: 87071
2009-11-13 02:35:38 +00:00
Mike Stump
653d0b99df Refine the construction vtables with respect to offsets. WIP.
llvm-svn: 87067
2009-11-13 02:13:54 +00:00
Mike Stump
83066c8dee Allow the tracking of address points for construction vtables as well.
llvm-svn: 87063
2009-11-13 01:54:23 +00:00
Mike Stump
2b34bc5a96 Refine which vtbl is refernced in VTTs.
llvm-svn: 87043
2009-11-12 23:36:21 +00:00
Mike Stump
ca0de33113 Refine offsets into vtables for the VTT.
llvm-svn: 87041
2009-11-12 23:14:15 +00:00
Mike Stump
8677bc27bf Refine vtable pointers for secondary vtables inside VTTs to point to
the right base vtable.  WIP.

llvm-svn: 87039
2009-11-12 22:56:32 +00:00
Mike Stump
2cefe38365 Fix the offset calculations for non-virtual bases with overrides.
Refine the VTT entries for virtual bases to refer to the complete
object's vtable instead of constructor vtables.

Refine the AddressPoint calculations for VTT entries for virtual bases.

llvm-svn: 87021
2009-11-12 20:47:57 +00:00