Add a new (static inline) std::ostream& << AllocInfo& method. Use it.

llvm-svn: 11002
diff --git a/llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h b/llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h
index 67f58a7..b440752 100644
--- a/llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h
+++ b/llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h
@@ -79,6 +79,13 @@
   }
 };
 
+static inline std::ostream &operator << (std::ostream &OS, AllocInfo &S) {
+  OS << "(Instruction " << S.Instruction << " Operand " << S.Operand
+     << " AllocState " << S.allocStateToString () << " Placement "
+     << S.Placement << ")";
+  return OS;
+}
+
 } // End llvm namespace
 
 #endif // ALLOCINFO_H
diff --git a/llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp b/llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp
index a9a5f3d..0f1f6d2 100644
--- a/llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp
+++ b/llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp
@@ -1201,12 +1201,8 @@
     std::cerr << "FnAllocState:\n";
     for (unsigned i = 0; i < state.size (); ++i) {
       AllocInfo &S = state[i];
-      if (Insn == S.Instruction) {
-        std::cerr << "  (Instruction " << S.Instruction
-                  << ", Operand " << S.Operand
-                  << ", AllocState " << S.allocStateToString ()
-                  << ", Placement " << S.Placement << ")\n";
-      }
+      if (Insn == S.Instruction)
+        std::cerr << "  " << S << "\n";
     }
     std::cerr << "----------\n";
     ++Insn;