Skip to content

Commit d2d1c45

Browse files
committed
RustWrapper: Suppress getNextNonDebugInfoInstruction
Link: llvm/llvm-project#144383
1 parent 20aa182 commit d2d1c45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,11 @@ extern "C" void LLVMRustPositionBefore(LLVMBuilderRef B, LLVMValueRef Instr) {
16101610

16111611
extern "C" void LLVMRustPositionAfter(LLVMBuilderRef B, LLVMValueRef Instr) {
16121612
if (auto I = dyn_cast<Instruction>(unwrap<Value>(Instr))) {
1613+
#if LLVM_VERSION_GE(22, 0)
1614+
auto J = I->getNextNode();
1615+
#else
16131616
auto J = I->getNextNonDebugInstruction();
1617+
#endif
16141618
unwrap(B)->SetInsertPoint(J);
16151619
}
16161620
}

0 commit comments

Comments
 (0)