From e14962a39cc6476bebba65e5639b74b0318c7fc3 Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Mon, 27 Jan 2025 15:25:17 +0000 Subject: [NFC][DebugInfo] Use iterators for instruction insertion in more places (#124291) As part of the "RemoveDIs" work to eliminate debug intrinsics, we're replacing methods that use Instruction*'s as positions with iterators. This patch changes some more complex call-sites, those crossing file boundaries and where I've had to perform some minor rewrites. --- llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 6a8a468..adc40da 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -184,14 +184,14 @@ namespace { } // end anonymous namespace static IntrinsicInst *getConvergenceEntry(BasicBlock &BB) { - auto *I = BB.getFirstNonPHI(); - while (I) { - if (auto *IntrinsicCall = dyn_cast(I)) { + BasicBlock::iterator It = BB.getFirstNonPHIIt(); + while (It != BB.end()) { + if (auto *IntrinsicCall = dyn_cast(It)) { if (IntrinsicCall->isEntry()) { return IntrinsicCall; } } - I = I->getNextNode(); + It = std::next(It); } return nullptr; } -- cgit v1.1