[llvm-commits] CVS: llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h PhyRegAlloc.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Wed Jan 28 13:06:03 PST 2004


Changes in directory llvm/lib/Target/Sparc/RegAlloc:

AllocInfo.h updated: 1.5 -> 1.6
PhyRegAlloc.cpp updated: 1.131 -> 1.132

---
Log message:

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


---
Diffs of the changes:  (+9 -6)

Index: llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h
diff -u llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h:1.5 llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h:1.6
--- llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h:1.5	Tue Nov 11 16:41:33 2003
+++ llvm/lib/Target/Sparc/RegAlloc/AllocInfo.h	Wed Jan 28 13:05:43 2004
@@ -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


Index: llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.131 llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.132
--- llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp:1.131	Sun Dec 14 07:24:15 2003
+++ llvm/lib/Target/Sparc/RegAlloc/PhyRegAlloc.cpp	Wed Jan 28 13:05:43 2004
@@ -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;





More information about the llvm-commits mailing list