MachineBasicBlock: Add liveins() method returning an iterator_range

llvm-svn: 245895
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 05bb320..297e1f8 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -473,10 +473,12 @@
   assert(TRI && "Expected target register info");
   if (!MBB.livein_empty()) {
     OS.indent(2) << "liveins: ";
-    for (auto I = MBB.livein_begin(), E = MBB.livein_end(); I != E; ++I) {
-      if (I != MBB.livein_begin())
+    bool First = true;
+    for (unsigned LI : MBB.liveins()) {
+      if (!First)
         OS << ", ";
-      printReg(*I, OS, TRI);
+      First = false;
+      printReg(LI, OS, TRI);
     }
     OS << "\n";
     HasLineAttributes = true;