]> granicus.if.org Git - clang/commitdiff
Add the thunks needed by this vtable.
authorAnders Carlsson <andersca@mac.com>
Mon, 29 Mar 2010 01:38:05 +0000 (01:38 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 29 Mar 2010 01:38:05 +0000 (01:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99793 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 1c94a4e73e99e7f2728bbdef7b73bc260e3f7d1b..592f782edc9266c86287686793546bda6511a51b 100644 (file)
@@ -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();