Skip to content

Commit adb62c1

Browse files
authored
Update for getPrefTypeAlignment API deprecation (#1825)
Update for llvm-project commit 89427bb7cbd1 ("[NFC] Deprecate DataLayout::getPrefTypeAlignment", 2023-01-24).
1 parent 3bc3d69 commit adb62c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SPIRV/OCLToSPIRV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ void OCLToSPIRVBase::visitCallEnqueueKernel(CallInst *CI,
14031403
// TODO: these numbers should be obtained from block literal structure
14041404
Type *ParamType = getBlockStructType(BlockLiteral);
14051405
Args.push_back(getInt32(M, DL.getTypeStoreSize(ParamType)));
1406-
Args.push_back(getInt32(M, DL.getPrefTypeAlignment(ParamType)));
1406+
Args.push_back(getInt32(M, DL.getPrefTypeAlign(ParamType).value()));
14071407

14081408
// Local sizes arguments: Sizes of block invoke arguments
14091409
// Clang 6.0 and higher generates local size operands as an array,
@@ -1457,7 +1457,7 @@ void OCLToSPIRVBase::visitCallKernelQuery(CallInst *CI,
14571457
// Add Param Size and Param Align at the end.
14581458
Args[BlockFIdx] = BlockF;
14591459
Args.push_back(getInt32(M, DL.getTypeStoreSize(ParamType)));
1460-
Args.push_back(getInt32(M, DL.getPrefTypeAlignment(ParamType)));
1460+
Args.push_back(getInt32(M, DL.getPrefTypeAlign(ParamType).value()));
14611461

14621462
Op Opcode = OCLSPIRVBuiltinMap::map(DemangledName.str());
14631463
// Adding "__" postfix, so in case we have multiple such

0 commit comments

Comments
 (0)