@@ -1341,14 +1341,9 @@ void ItaniumVTableBuilder::AddMethod(const CXXMethodDecl *MD,
13411341 if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
13421342 assert (ReturnAdjustment.isEmpty () &&
13431343 " Destructor can't have return adjustment!" );
1344- if (!Context.getTargetInfo ().getCXXABI ().isMicrosoft ()) {
1345- // Add both the complete destructor and the deleting destructor.
1346- Components.push_back (VTableComponent::MakeCompleteDtor (DD));
1347- Components.push_back (VTableComponent::MakeDeletingDtor (DD));
1348- } else {
1349- // Add the vector deleting destructor.
1350- Components.push_back (VTableComponent::MakeDeletingDtor (DD));
1351- }
1344+ // Add both the complete destructor and the deleting destructor.
1345+ Components.push_back (VTableComponent::MakeCompleteDtor (DD));
1346+ Components.push_back (VTableComponent::MakeDeletingDtor (DD));
13521347 } else {
13531348 // Add the return adjustment if necessary.
13541349 if (!ReturnAdjustment.isEmpty ())
@@ -1737,15 +1732,10 @@ void ItaniumVTableBuilder::LayoutPrimaryAndSecondaryVTables(
17371732 const CXXMethodDecl *MD = I.first ;
17381733 const MethodInfo &MI = I.second ;
17391734 if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
1740- if (!Context.getTargetInfo ().getCXXABI ().isMicrosoft ()) {
1741- MethodVTableIndices[GlobalDecl (DD, Dtor_Complete)] =
1742- MI.VTableIndex - AddressPoint;
1743- MethodVTableIndices[GlobalDecl (DD, Dtor_Deleting)] =
1744- MI.VTableIndex + 1 - AddressPoint;
1745- } else {
1746- MethodVTableIndices[GlobalDecl (DD, Dtor_VectorDeleting)] =
1747- MI.VTableIndex + 1 - AddressPoint;
1748- }
1735+ MethodVTableIndices[GlobalDecl (DD, Dtor_Complete)]
1736+ = MI.VTableIndex - AddressPoint;
1737+ MethodVTableIndices[GlobalDecl (DD, Dtor_Deleting)]
1738+ = MI.VTableIndex + 1 - AddressPoint;
17491739 } else {
17501740 MethodVTableIndices[MD] = MI.VTableIndex - AddressPoint;
17511741 }
@@ -2080,8 +2070,6 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) {
20802070 DD->printQualifiedName (Out);
20812071 if (IsComplete)
20822072 Out << " () [complete]" ;
2083- else if (Context.getTargetInfo ().getCXXABI ().isMicrosoft ())
2084- Out << " () [vector deleting]" ;
20852073 else
20862074 Out << " () [deleting]" ;
20872075
@@ -2257,28 +2245,12 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) {
22572245 PredefinedIdentKind::PrettyFunctionNoVirtual, MD);
22582246
22592247 if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
2260- if (!Context.getTargetInfo ().getCXXABI ().isMicrosoft ()) {
2261- // For Itanium ABI, add entries for both complete and deleting
2262- // destructors.
2263- GlobalDecl CompleteGD (DD, Dtor_Complete);
2264- assert (MethodVTableIndices.count (CompleteGD));
2265- uint64_t CompleteIndex = MethodVTableIndices[CompleteGD];
2266- IndicesMap[CompleteIndex] = MethodName + " [complete]" ;
2267-
2268- GlobalDecl DeletingGD (DD, Dtor_Deleting);
2269- assert (MethodVTableIndices.count (DeletingGD));
2270- uint64_t DeletingIndex = MethodVTableIndices[DeletingGD];
2271- IndicesMap[DeletingIndex] = MethodName + " [deleting]" ;
2272- } else {
2273- // For Microsoft ABI, add an entry for the vector deleting destructor.
2274- // Ensure that the index calculation is correct for the Microsoft ABI.
2275- GlobalDecl VectorDeletingGD (DD, Dtor_VectorDeleting);
2276- assert (MethodVTableIndices.count (VectorDeletingGD));
2277- uint64_t VectorDeletingIndex = MethodVTableIndices[VectorDeletingGD];
2278- IndicesMap[VectorDeletingIndex] = MethodName + " [vector deleting]" ;
2279- }
2248+ GlobalDecl GD (DD, Dtor_Complete);
2249+ assert (MethodVTableIndices.count (GD));
2250+ uint64_t VTableIndex = MethodVTableIndices[GD];
2251+ IndicesMap[VTableIndex] = MethodName + " [complete]" ;
2252+ IndicesMap[VTableIndex + 1 ] = MethodName + " [deleting]" ;
22802253 } else {
2281- // For other virtual member functions, add an entry with the method name.
22822254 assert (MethodVTableIndices.count (MD));
22832255 IndicesMap[MethodVTableIndices[MD]] = MethodName;
22842256 }
@@ -3790,7 +3762,7 @@ void MicrosoftVTableContext::dumpMethodLocations(
37903762 PredefinedIdentKind::PrettyFunctionNoVirtual, MD);
37913763
37923764 if (isa<CXXDestructorDecl>(MD)) {
3793- IndicesMap[I.second ] = MethodName + " [vector deleting]" ;
3765+ IndicesMap[I.second ] = MethodName + " [deleting]" ;
37943766 } else {
37953767 IndicesMap[I.second ] = MethodName;
37963768 }
0 commit comments