Convert AddedInstrMapType to contain AddedInstrns by value instead of by
[oota-llvm.git] / lib / CodeGen / RegAlloc / RegClass.cpp
index 3918871d69f16f71ea94632caf78306acf1cff11..a0d43c80b1faff0b471f5927b6b0644b2e6e7ffd 100644 (file)
@@ -1,17 +1,18 @@
 #include "llvm/CodeGen/RegClass.h"
-
+#include <iostream>
+using std::cerr;
 
 //----------------------------------------------------------------------------
 // This constructor inits IG. The actual matrix is created by a call to 
 // createInterferenceGraph() above.
 //----------------------------------------------------------------------------
-RegClass::RegClass(const Method *const M, 
-                  const MachineRegClassInfo *const Mrc, 
-                  const ReservedColorListType *const RCL)
+RegClass::RegClass(const Function *M, 
+                  const MachineRegClassInfo *Mrc,
+                  const ReservedColorListType *RCL)
                   :  Meth(M), MRC(Mrc), RegClassID( Mrc->getRegClassID() ),
                      IG(this), IGNodeStack(), ReservedColorList(RCL) {
   if( DEBUG_RA)
-    cout << "Created Reg Class: " << RegClassID << endl;
+    cerr << "Created Reg Class: " << RegClassID << "\n";
 
   IsColorUsedArr = new bool[ Mrc->getNumOfAllRegs() ];
 }
@@ -23,7 +24,7 @@ RegClass::RegClass(const Method *const M,
 //----------------------------------------------------------------------------
 void RegClass::colorAllRegs()
 {
-  if(DEBUG_RA) cout << "Coloring IG of reg class " << RegClassID << " ...\n";
+  if(DEBUG_RA) cerr << "Coloring IG of reg class " << RegClassID << " ...\n";
 
                                         // pre-color IGNodes
   pushAllIGNodes();                     // push all IG Nodes
@@ -57,9 +58,9 @@ void RegClass::pushAllIGNodes()
   bool PushedAll  = pushUnconstrainedIGNodes(); 
 
   if( DEBUG_RA) {
-    cout << " Puhsed all-unconstrained IGNodes. ";
-    if( PushedAll ) cout << " No constrained nodes left.";
-    cout << endl;
+    cerr << " Puhsed all-unconstrained IGNodes. ";
+    if( PushedAll ) cerr << " No constrained nodes left.";
+    cerr << "\n";
   }
 
   if( PushedAll )                       // if NO constrained nodes left
@@ -129,8 +130,8 @@ bool  RegClass::pushUnconstrainedIGNodes()
       IGNode->pushOnStack();            // set OnStack and dec deg of neighs
 
       if (DEBUG_RA > 1) {
-       cout << " pushed un-constrained IGNode " << IGNode->getIndex() ;
-       cout << " on to stack" << endl;
+       cerr << " pushed un-constrained IGNode " << IGNode->getIndex() ;
+       cerr << " on to stack\n";
       }
     }
     else pushedall = false;             // we didn't push all live ranges
@@ -215,16 +216,16 @@ void RegClass::colorIGNode(IGNode *const Node)
   }
   else {
     if( DEBUG_RA ) {
-      cout << " Node " << Node->getIndex();
-      cout << " already colored with color " << Node->getColor() << endl;
+      cerr << " Node " << Node->getIndex();
+      cerr << " already colored with color " << Node->getColor() << "\n";
     }
   }
 
 
   if( !Node->hasColor() ) {
     if( DEBUG_RA ) {
-      cout << " Node " << Node->getIndex();
-      cout << " - could not find a color (needs spilling)" << endl;
+      cerr << " Node " << Node->getIndex();
+      cerr << " - could not find a color (needs spilling)\n";
     }
   }