From cd6d9ae26313258d4dbf8a5db4d977434c03ed6a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 22 Mar 2022 16:19:00 +0100 Subject: [PATCH] [CGOpenMPRuntime] Remove some uses of deprecated Adddress ctor --- clang/lib/CodeGen/CGOpenMPRuntime.cpp | 40 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 66a87fd..24cd78a 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -6232,12 +6232,12 @@ Address CGOpenMPRuntime::getTaskReductionItem(CodeGenFunction &CGF, ReductionsPtr, CGF.Builder.CreatePointerBitCastOrAddrSpaceCast( SharedLVal.getPointer(CGF), CGM.VoidPtrTy)}; - return Address::deprecated( + return Address( CGF.EmitRuntimeCall( OMPBuilder.getOrCreateRuntimeFunction( CGM.getModule(), OMPRTL___kmpc_task_reduction_get_th_data), Args), - SharedLVal.getAlignment()); + CGF.Int8Ty, SharedLVal.getAlignment()); } void CGOpenMPRuntime::emitTaskwaitCall(CodeGenFunction &CGF, SourceLocation Loc, @@ -9053,16 +9053,13 @@ public: void generateInfoForLambdaCaptures( const ValueDecl *VD, llvm::Value *Arg, MapCombinedInfoTy &CombinedInfo, llvm::DenseMap &LambdaPointers) const { - const auto *RD = VD->getType() - .getCanonicalType() - .getNonReferenceType() - ->getAsCXXRecordDecl(); + QualType VDType = VD->getType().getCanonicalType().getNonReferenceType(); + const auto *RD = VDType->getAsCXXRecordDecl(); if (!RD || !RD->isLambda()) return; - Address VDAddr = - Address::deprecated(Arg, CGF.getContext().getDeclAlign(VD)); - LValue VDLVal = CGF.MakeAddrLValue( - VDAddr, VD->getType().getCanonicalType().getNonReferenceType()); + Address VDAddr(Arg, CGF.ConvertTypeForMem(VDType), + CGF.getContext().getDeclAlign(VD)); + LValue VDLVal = CGF.MakeAddrLValue(VDAddr, VDType); llvm::DenseMap Captures; FieldDecl *ThisCapture = nullptr; RD->getCaptureFields(Captures, ThisCapture); @@ -10622,13 +10619,13 @@ void CGOpenMPRuntime::emitTargetCall( InputInfo.NumberOfTargetItems = Info.NumberOfPtrs; InputInfo.BasePointersArray = - Address::deprecated(Info.BasePointersArray, CGM.getPointerAlign()); + Address(Info.BasePointersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); InputInfo.PointersArray = - Address::deprecated(Info.PointersArray, CGM.getPointerAlign()); + Address(Info.PointersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); InputInfo.SizesArray = - Address::deprecated(Info.SizesArray, CGM.getPointerAlign()); + Address(Info.SizesArray, CGF.Int64Ty, CGM.getPointerAlign()); InputInfo.MappersArray = - Address::deprecated(Info.MappersArray, CGM.getPointerAlign()); + Address(Info.MappersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); MapTypesArray = Info.MapTypesArray; MapNamesArray = Info.MapNamesArray; if (RequiresOuterTask) @@ -11505,13 +11502,13 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall( {/*ForEndCall=*/false}); InputInfo.NumberOfTargetItems = Info.NumberOfPtrs; InputInfo.BasePointersArray = - Address::deprecated(Info.BasePointersArray, CGM.getPointerAlign()); + Address(Info.BasePointersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); InputInfo.PointersArray = - Address::deprecated(Info.PointersArray, CGM.getPointerAlign()); + Address(Info.PointersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); InputInfo.SizesArray = - Address::deprecated(Info.SizesArray, CGM.getPointerAlign()); + Address(Info.SizesArray, CGF.Int64Ty, CGM.getPointerAlign()); InputInfo.MappersArray = - Address::deprecated(Info.MappersArray, CGM.getPointerAlign()); + Address(Info.MappersArray, CGF.VoidPtrTy, CGM.getPointerAlign()); MapTypesArray = Info.MapTypesArray; MapNamesArray = Info.MapNamesArray; if (RequiresOuterTask) @@ -12362,9 +12359,10 @@ Address CGOpenMPRuntime::getAddressOfLocalVariable(CodeGenFunction &CGF, CGF.EmitRuntimeCall(RTLFn, Args); } }; - Address VDAddr = UntiedRealAddr.isValid() - ? UntiedRealAddr - : Address::deprecated(Addr, Align); + Address VDAddr = + UntiedRealAddr.isValid() + ? UntiedRealAddr + : Address(Addr, CGF.ConvertTypeForMem(CVD->getType()), Align); CGF.EHStack.pushCleanup( NormalAndEHCleanup, FiniRTLFn, CVD->getLocation().getRawEncoding(), VDAddr, Allocator); -- 2.7.4