Skip to content

Commit 6c96bf7

Browse files
svenvhjsji
authored andcommitted
Update for deprecation of insertBefore/moveBefore (#2977)
Update for llvm-project commit 79499f0 ("[NFC][DebugInfo] Deprecate iterator-taking moveBefore and getFirstNonPHI (#124290)", 2025-01-28). Original commit: KhronosGroup/SPIRV-LLVM-Translator@1d4c8d409516321
1 parent 55e71fb commit 6c96bf7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm-spirv/lib/SPIRV/SPIRVLowerConstExpr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ bool SPIRVLowerConstExprBase::visit(Module *M) {
124124
auto *CE = cast<ConstantExpr>(V);
125125
SPIRVDBG(dbgs() << "[lowerConstantExpressions] " << *CE;)
126126
auto *ReplInst = CE->getAsInstruction();
127-
auto *InsPoint = II->getParent() == &*FBegin ? II : &FBegin->back();
127+
auto InsPoint = II->getParent() == &*FBegin
128+
? II->getIterator()
129+
: FBegin->back().getIterator();
128130
ReplInst->insertBefore(InsPoint);
129131
SPIRVDBG(dbgs() << " -> " << *ReplInst << '\n';)
130132
std::vector<Instruction *> Users;
@@ -140,7 +142,7 @@ bool SPIRVLowerConstExprBase::visit(Module *M) {
140142
for (auto &User : Users) {
141143
if (ReplInst->getParent() == User->getParent())
142144
if (User->comesBefore(ReplInst))
143-
ReplInst->moveBefore(User);
145+
ReplInst->moveBefore(User->getIterator());
144146
User->replaceUsesOfWith(CE, ReplInst);
145147
}
146148
Changed = true;

0 commit comments

Comments
 (0)