auto ClassDecl = ResultType->getPointeeType()->getAsCXXRecordDecl();
auto ClassAlign = CGF.CGM.getClassPointerAlignment(ClassDecl);
ReturnValue = CGF.CGM.getCXXABI().performReturnAdjustment(
- CGF, Address::deprecated(ReturnValue, ClassAlign), Thunk.Return);
+ CGF,
+ Address(ReturnValue, CGF.ConvertTypeForMem(ResultType->getPointeeType()),
+ ClassAlign),
+ Thunk.Return);
if (NullCheckValue) {
CGF.Builder.CreateBr(AdjustEnd);
// Find the first store of "this", which will be to the alloca associated
// with "this".
Address ThisPtr =
- Address::deprecated(&*AI, CGM.getClassPointerAlignment(MD->getParent()));
+ Address(&*AI, ConvertTypeForMem(MD->getThisType()->getPointeeType()),
+ CGM.getClassPointerAlignment(MD->getParent()));
llvm::BasicBlock *EntryBB = &Fn->front();
llvm::BasicBlock::iterator ThisStore =
llvm::find_if(*EntryBB, [&](llvm::Instruction &I) {