diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2025-01-27 15:25:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-27 15:25:17 +0000 |
commit | e14962a39cc6476bebba65e5639b74b0318c7fc3 (patch) | |
tree | 2c5f513c4703b51bc8ea723fe2890910fe7b30e6 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 5aafc6d58f3405662902cee006be11e599801b88 (diff) | |
download | llvm-e14962a39cc6476bebba65e5639b74b0318c7fc3.zip llvm-e14962a39cc6476bebba65e5639b74b0318c7fc3.tar.gz llvm-e14962a39cc6476bebba65e5639b74b0318c7fc3.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<ConvergenceControlInst>(I)) { + BasicBlock::iterator It = BB.getFirstNonPHIIt(); + while (It != BB.end()) { + if (auto *IntrinsicCall = dyn_cast<ConvergenceControlInst>(It)) { if (IntrinsicCall->isEntry()) { return IntrinsicCall; } } - I = I->getNextNode(); + It = std::next(It); } return nullptr; } |