Skip to content

Commit

Permalink
Update for deprecation of llvm::PointerUnion::get (#2961)
Browse files Browse the repository at this point in the history
Update for llvm-project commit abba01adad5d ("[ADT] Deprecate
PointerUnion::{is,get} (NFC) (#122623)", 2025-01-13).
  • Loading branch information
svenvh authored Jan 14, 2025
1 parent a35a761 commit d9e871a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/SPIRV/SPIRVToLLVMDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ SPIRVToLLVMDbgTran::transTypeArrayNonSemantic(const SPIRVExtInst *DebugInst) {
if (DebugInst->getExtOp() == SPIRVDebug::TypeArray) {
for (size_t I = SubrangesIdx; I < Ops.size(); ++I) {
auto *SR = transDebugInst<DISubrange>(BM->get<SPIRVExtInst>(Ops[I]));
if (auto *Count = SR->getCount().get<ConstantInt *>())
if (auto *Count = cast<ConstantInt *>(SR->getCount()))
TotalCount *= Count->getSExtValue() > 0 ? Count->getSExtValue() : 0;
Subscripts.push_back(SR);
}
Expand All @@ -444,7 +444,7 @@ SPIRVToLLVMDbgTran::transTypeArrayDynamic(const SPIRVExtInst *DebugInst) {
SmallVector<llvm::Metadata *, 8> Subscripts;
for (size_t I = SubrangesIdx; I < Ops.size(); ++I) {
auto *SR = transDebugInst<DISubrange>(BM->get<SPIRVExtInst>(Ops[I]));
if (auto *Count = SR->getCount().get<ConstantInt *>())
if (auto *Count = cast<ConstantInt *>(SR->getCount()))
TotalCount *= Count->getSExtValue() > 0 ? Count->getSExtValue() : 0;
Subscripts.push_back(SR);
}
Expand Down Expand Up @@ -1607,10 +1607,10 @@ SPIRVToLLVMDbgTran::transDebugIntrinsic(const SPIRVExtInst *DebugInst,
if (!MDs.empty()) {
DIArgList *AL = DIArgList::get(M->getContext(), MDs);
if (M->IsNewDbgInfoFormat) {
cast<DbgVariableRecord>(DbgValIntr.get<DbgRecord *>())
cast<DbgVariableRecord>(cast<DbgRecord *>(DbgValIntr))
->setRawLocation(AL);
} else {
cast<DbgVariableIntrinsic>(DbgValIntr.get<Instruction *>())
cast<DbgVariableIntrinsic>(cast<Instruction *>(DbgValIntr))
->setRawLocation(AL);
}
}
Expand Down

0 comments on commit d9e871a

Please sign in to comment.