Thunks.erase(i);
}
-
- QualType BaseType = QualType(Thunk.ReturnType)->getPointeeType();
+
+ // Construct the return adjustment.
QualType DerivedType =
- MD->getType()->getAs<FunctionType>()->getResultType()->getPointeeType();
+ MD->getType()->getAs<FunctionType>()->getResultType();
- const CXXRecordDecl *BaseDecl =
- cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl());
+ int64_t NonVirtualAdjustment =
+ getNVOffset(Thunk.ReturnType, DerivedType) / 8;
- const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(DerivedType->getAs<RecordType>()->getDecl());
+ int64_t VirtualAdjustment =
+ getVbaseOffset(Thunk.ReturnType, DerivedType);
- // Construct the return adjustment.
- ThunkAdjustment ReturnAdjustment =
- CGM.ComputeThunkAdjustment(DerivedDecl, BaseDecl);
+ ThunkAdjustment ReturnAdjustment(NonVirtualAdjustment, VirtualAdjustment);
CovariantThunkAdjustment Adjustment(ThisAdjustment, ReturnAdjustment);
submethods[Index] = CGM.BuildCovariantThunk(MD, Extern, Adjustment);
}
const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
+ cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
const CXXRecordDecl *BaseDecl =
cast<CXXRecordDecl>(cast<RecordType>(CanBaseType)->getDecl());