Skip to content

Commit cbc1b1b

Browse files
svenvhjsji
authored andcommitted
Update for deprecation of llvm::PointerUnion::get (#2961)
Update for llvm-project commit abba01a ("[ADT] Deprecate PointerUnion::{is,get} (NFC) (#122623)", 2025-01-13). Original commit: KhronosGroup/SPIRV-LLVM-Translator@d9e871ae7e694dc
1 parent f260c2e commit cbc1b1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm-spirv/lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ SPIRVToLLVMDbgTran::transTypeArrayNonSemantic(const SPIRVExtInst *DebugInst) {
421421
if (DebugInst->getExtOp() == SPIRVDebug::TypeArray) {
422422
for (size_t I = SubrangesIdx; I < Ops.size(); ++I) {
423423
auto *SR = transDebugInst<DISubrange>(BM->get<SPIRVExtInst>(Ops[I]));
424-
if (auto *Count = SR->getCount().get<ConstantInt *>())
424+
if (auto *Count = cast<ConstantInt *>(SR->getCount()))
425425
TotalCount *= Count->getSExtValue() > 0 ? Count->getSExtValue() : 0;
426426
Subscripts.push_back(SR);
427427
}
@@ -444,7 +444,7 @@ SPIRVToLLVMDbgTran::transTypeArrayDynamic(const SPIRVExtInst *DebugInst) {
444444
SmallVector<llvm::Metadata *, 8> Subscripts;
445445
for (size_t I = SubrangesIdx; I < Ops.size(); ++I) {
446446
auto *SR = transDebugInst<DISubrange>(BM->get<SPIRVExtInst>(Ops[I]));
447-
if (auto *Count = SR->getCount().get<ConstantInt *>())
447+
if (auto *Count = cast<ConstantInt *>(SR->getCount()))
448448
TotalCount *= Count->getSExtValue() > 0 ? Count->getSExtValue() : 0;
449449
Subscripts.push_back(SR);
450450
}
@@ -1607,10 +1607,10 @@ SPIRVToLLVMDbgTran::transDebugIntrinsic(const SPIRVExtInst *DebugInst,
16071607
if (!MDs.empty()) {
16081608
DIArgList *AL = DIArgList::get(M->getContext(), MDs);
16091609
if (M->IsNewDbgInfoFormat) {
1610-
cast<DbgVariableRecord>(DbgValIntr.get<DbgRecord *>())
1610+
cast<DbgVariableRecord>(cast<DbgRecord *>(DbgValIntr))
16111611
->setRawLocation(AL);
16121612
} else {
1613-
cast<DbgVariableIntrinsic>(DbgValIntr.get<Instruction *>())
1613+
cast<DbgVariableIntrinsic>(cast<Instruction *>(DbgValIntr))
16141614
->setRawLocation(AL);
16151615
}
16161616
}

0 commit comments

Comments
 (0)