From b8f0e12847f5df0792c816c995bc67759aea669e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 22 Mar 2022 09:52:12 +0100 Subject: [PATCH] [CodeGen] Remove some uses of deprecated Address constructor Remove two stray uses in CodeGenModule and CGCUDANV. --- clang/lib/CodeGen/CGCUDANV.cpp | 6 +++--- clang/lib/CodeGen/CodeGenModule.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/lib/CodeGen/CGCUDANV.cpp b/clang/lib/CodeGen/CGCUDANV.cpp index b832c68..3ae152d 100644 --- a/clang/lib/CodeGen/CGCUDANV.cpp +++ b/clang/lib/CodeGen/CGCUDANV.cpp @@ -965,9 +965,9 @@ llvm::Function *CGNVCUDARuntime::makeModuleDtorFunction() { CGBuilderTy DtorBuilder(CGM, Context); DtorBuilder.SetInsertPoint(DtorEntryBB); - Address GpuBinaryAddr = Address::deprecated( - GpuBinaryHandle, - CharUnits::fromQuantity( GpuBinaryHandle->getAlignment())); + Address GpuBinaryAddr( + GpuBinaryHandle, GpuBinaryHandle->getValueType(), + CharUnits::fromQuantity(GpuBinaryHandle->getAlignment())); auto *HandleValue = DtorBuilder.CreateLoad(GpuBinaryAddr); // There is only one HIP fat binary per linked module, however there are // multiple destructor functions. Make sure the fat binary is unregistered diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d07a477..c90e042 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -6456,8 +6456,9 @@ void CodeGenModule::EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) { !VD->getAnyInitializer()->isConstantInitializer(getContext(), /*ForRef=*/false); - Address Addr = Address::deprecated(GetAddrOfGlobalVar(VD), - getContext().getDeclAlign(VD)); + Address Addr(GetAddrOfGlobalVar(VD), + getTypes().ConvertTypeForMem(VD->getType()), + getContext().getDeclAlign(VD)); if (auto InitFunction = getOpenMPRuntime().emitThreadPrivateVarDefinition( VD, Addr, RefExpr->getBeginLoc(), PerformInit)) CXXGlobalInits.push_back(InitFunction); -- 2.7.4