diff --git a/llvm/include/llvm/SandboxIR/PassManager.h b/llvm/include/llvm/SandboxIR/PassManager.h index eba72a310aa072e..8d7d31668658006 100644 --- a/llvm/include/llvm/SandboxIR/PassManager.h +++ b/llvm/include/llvm/SandboxIR/PassManager.h @@ -48,11 +48,7 @@ class PassManager : public ParentPass { void print(raw_ostream &OS) const override { OS << this->getName(); OS << "("; - for (auto [Idx, Pass] : enumerate(Passes)) { - OS << Pass->getName(); - if (Idx + 1 != Passes.size()) - OS << ","; - } + interleave(Passes, OS, [&OS](auto *Pass) { OS << Pass->getName(); }, ","); OS << ")"; } LLVM_DUMP_METHOD void dump() const override {