Simplify LiveInterval::print().

Don't print out the register number and spill weight, making the TRI
argument unnecessary.

This allows callers to interpret the reg field. It can currently be a
virtual register, a physical register, a spill slot, or a register unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158031 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 1265dc3..1431ba4 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -138,10 +138,8 @@
 
   // Dump the physregs.
   for (unsigned Reg = 1, RegE = TRI->getNumRegs(); Reg != RegE; ++Reg)
-    if (const LiveInterval *LI = R2IMap.lookup(Reg)) {
-      LI->print(OS, TRI);
-      OS << '\n';
-    }
+    if (const LiveInterval *LI = R2IMap.lookup(Reg))
+      OS << PrintReg(Reg, TRI) << '\t' << *LI << '\n';
 
   // Dump the regunits.
   for (unsigned i = 0, e = RegUnitIntervals.size(); i != e; ++i)
@@ -151,10 +149,8 @@
   // Dump the virtregs.
   for (unsigned Reg = 0, RegE = MRI->getNumVirtRegs(); Reg != RegE; ++Reg)
     if (const LiveInterval *LI =
-        R2IMap.lookup(TargetRegisterInfo::index2VirtReg(Reg))) {
-      LI->print(OS, TRI);
-      OS << '\n';
-    }
+        R2IMap.lookup(TargetRegisterInfo::index2VirtReg(Reg)))
+      OS << PrintReg(LI->reg) << '\t' << *LI << '\n';
 
   printInstrs(OS);
 }
@@ -352,10 +348,7 @@
         interval.addRange(LiveRange(RedefIndex, RedefIndex.getDeadSlot(),
                                     OldValNo));
 
-      DEBUG({
-          dbgs() << " RESULT: ";
-          interval.print(dbgs(), TRI);
-        });
+      DEBUG(dbgs() << " RESULT: " << interval);
     } else if (LV->isPHIJoin(interval.reg)) {
       // In the case of PHI elimination, each variable definition is only
       // live until the end of the block.  We've already taken care of the