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

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 13:21:56 PDT 2026


================
@@ -240,7 +240,7 @@ struct DOTGraphTraits<DOTFuncInfo *> : public DefaultDOTGraphTraits {
 
     // Label source of switch edges with the associated value.
     if (const SwitchInst *SI = dyn_cast<SwitchInst>(Node->getTerminator())) {
-      unsigned SuccNo = I.getSuccessorIndex();
+      unsigned SuccNo = std::distance(succ_begin(SI), I);
----------------
boomanaiden154 wrote:

That's not really the case here.

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


More information about the llvm-commits mailing list