[CodeGen] Remove some uses of deprecated Address constructor

Remove two stray uses in CodeGenModule and CGCUDANV.
This commit is contained in:
Nikita Popov
2022-03-22 09:52:12 +01:00
parent 8b295d1ca2
commit b8f0e12847
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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);