diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index 34df7da7985b..536db8dc4b41 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/lib/CodeGen/CGVTables.cpp @@ -91,7 +91,10 @@ static RValue PerformReturnAdjustment(CodeGenFunction &CGF, 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); @@ -198,7 +201,8 @@ CodeGenFunction::GenerateVarArgsThunk(llvm::Function *Fn, // 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) {