diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-29 01:38:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-29 01:38:05 +0000 |
commit | 276701f38d383e9bf036b6b4af60f7e18ec4e525 (patch) | |
tree | da24d98ac8e864cafb6ee7ac76f72b555c7c4d70 /lib/CodeGen/CGVtable.cpp | |
parent | aed924e9f210169c9a5b0ca30099fd2f479f2637 (diff) |
Add the thunks needed by this vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 1c94a4e73e..592f782edc 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -3963,6 +3963,17 @@ void CodeGenVTables::ComputeVTableRelatedInformation(const CXXRecordDecl *RD) { // Add the known thunks. Thunks.insert(Builder.thunks_begin(), Builder.thunks_end()); + // Add the thunks needed in this vtable. + assert(!VTableThunksMap.count(RD) && + "Thunks already exists for this vtable!"); + + VTableThunksTy &VTableThunks = VTableThunksMap[RD]; + VTableThunks.append(Builder.vtable_thunks_begin(), + Builder.vtable_thunks_end()); + + // Sort them. + std::sort(VTableThunks.begin(), VTableThunks.end()); + // Add the address points. for (VtableBuilder::AddressPointsMapTy::const_iterator I = Builder.address_points_begin(), E = Builder.address_points_end(); |