Skip to content

Commit 14e9f00

Browse files
svenvhvmaksimo
authored andcommitted
Update after ArrayRef(std::nullopt) deprecation (#3248)
Update for llvm-project commit 2529de5 ("[ADT] Deprecate ArrayRef(std::nullopt) (#146011)", 2025-06-27). Original commit: KhronosGroup/SPIRV-LLVM-Translator@e96d63a89c31ed4
1 parent f2320d5 commit 14e9f00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ void SPIRVToLLVM::setLLVMLoopMetadata(const LoopInstType *LM,
702702
if (!LM)
703703
return;
704704

705-
auto Temp = MDNode::getTemporary(*Context, std::nullopt);
705+
auto Temp = MDNode::getTemporary(*Context, {});
706706
auto *Self = MDNode::get(*Context, Temp.get());
707707
Self->replaceOperandWith(0, Self);
708708
SPIRVWord LC = LM->getLoopControl();
@@ -852,8 +852,7 @@ void SPIRVToLLVM::setLLVMLoopMetadata(const LoopInstType *LM,
852852
// Emit a distinct index group that will be referenced from
853853
// llvm.loop.parallel_access_indices metadata; hash the new
854854
// MDNode for future accesses to the same memory.
855-
CurrentDepthIdxGroup =
856-
llvm::MDNode::getDistinct(*Context, std::nullopt);
855+
CurrentDepthIdxGroup = llvm::MDNode::getDistinct(*Context, {});
857856
OffsetIdxGroupMap.emplace(Info, CurrentDepthIdxGroup);
858857
} else {
859858
// Previous accesses to that field have already been indexed,
@@ -863,8 +862,7 @@ void SPIRVToLLVM::setLLVMLoopMetadata(const LoopInstType *LM,
863862
} else /* Regular kernel-scope array/pointer variable */ {
864863
// Emit a distinct index group that will be referenced from
865864
// llvm.loop.parallel_access_indices metadata
866-
CurrentDepthIdxGroup =
867-
llvm::MDNode::getDistinct(*Context, std::nullopt);
865+
CurrentDepthIdxGroup = llvm::MDNode::getDistinct(*Context, {});
868866
}
869867

870868
unsigned Safelen = PointerSflnMap.find(ArrayGEPIt.first)->second;

0 commit comments

Comments
 (0)