[llvm] [IR] Implement successors as Use iterators (PR #186616)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 12:39:43 PDT 2026


================

----------------
aengelke wrote:

Then we end up with `return I ? I->successors() : const_succ_range(const_succ_iterator(nullptr), const_succ_iterator(nullptr));` :( — we can do this if you like, but I'd rather get rid of nullable Instruction support first.

Instruction::successors() is marked as pure and Clang/LLVM does eliminate the second call, so this is not going to be a problem in practice.

https://github.com/llvm/llvm-project/pull/186616


More information about the llvm-commits mailing list