Get rid of calls to void llvm::printSet(const ValueSet &).
authorBrian Gaeke <gaeke@uiuc.edu>
Thu, 29 Jul 2004 06:43:08 +0000 (06:43 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Thu, 29 Jul 2004 06:43:08 +0000 (06:43 +0000)
Use LiveRange's iterator types and operations instead of ValueSet's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/SparcV9RegClassInfo.cpp

index 2388ff02550005eca212a9ae61e9a1ba7bcad30b..b2b49d546524aa0218d8e66ccc45ab0ffeda350f 100644 (file)
@@ -65,11 +65,9 @@ void LiveRangeInfo::unionAndUpdateLRs(LiveRange *L1, LiveRange *L2) {
   assert(! (L1->hasColor() && L2->hasColor()) ||
          L1->getColor() == L2->getColor());
 
-  set_union(*L1, *L2);                   // add elements of L2 to L1
-
-  for(ValueSet::iterator L2It = L2->begin(); L2It != L2->end(); ++L2It) {
-    //assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
+  L2->insert (L1->begin(), L1->end());   // add elements of L2 to L1
 
+  for(LiveRange::iterator L2It = L2->begin(); L2It != L2->end(); ++L2It) {
     L1->insert(*L2It);                  // add the var in L2 to L1
     LiveRangeMap[*L2It] = L1;           // now the elements in L2 should map 
                                         //to L1    
@@ -408,7 +406,7 @@ void LiveRangeInfo::printLiveRanges() {
         std::cerr << "LR# " << igNode->getIndex();
       else
         std::cerr << "LR# " << "<no-IGNode>";
-      std::cerr << "\t:Values = "; printSet(*HMI->second); std::cerr << "\n";
+      std::cerr << "\t:Values = " << *HMI->second << "\n";
     }
   }
 }
index 2e835414e1e354fbaabf1bf1848bf6dfbf8366e5..fdd53bc18439320bd281a0a1dfc02a34e4070944 100644 (file)
@@ -41,10 +41,9 @@ void SparcV9IntRegClass::colorIGNode(IGNode * Node,
 {
   LiveRange *LR = Node->getParentLR();
 
-  if (DEBUG_RA) {
-    std::cerr << "\nColoring LR [CallInt=" << LR->isCallInterference() <<"]:"; 
-    printSet(*LR);
-  }
+  if (DEBUG_RA)
+    std::cerr << "\nColoring LR [CallInt=" << LR->isCallInterference() <<"]:"
+              << *LR << "\n"; 
 
   if (LR->hasSuggestedColor()) {
     unsigned SugCol = LR->getSuggestedColor();
@@ -61,8 +60,8 @@ void SparcV9IntRegClass::colorIGNode(IGNode * Node,
         std::cerr << "\n Couldn't alloc Sug col - LR volatile & calls interf";
       }
     } else if (DEBUG_RA) {                // can't allocate the suggested col
-      std::cerr << "\n  Could NOT allocate the suggested color (already used) ";
-      printSet(*LR); std::cerr << "\n";
+      std::cerr << "\n  Could NOT allocate the suggested color (already used) "
+                << *LR << "\n";
     }
   }
 
@@ -162,7 +161,7 @@ void SparcV9IntCCRegClass::colorIGNode(IGNode *Node,
 #ifndef NDEBUG
   // Let's just make sure values of two different types have not been
   // coalesced into this LR.
-  for (ValueSet::const_iterator I=ccLR->begin(), E=ccLR->end(); I!=E; ++I) {
+  for (LiveRange::const_iterator I=ccLR->begin(), E=ccLR->end(); I!=E; ++I) {
     const Type* ccType = (*I)->getType();
     assert((ccReg == xcc && (isa<PointerType>(ccType)
                              || ccType == Type::LongTy)) ||
@@ -251,8 +250,8 @@ void SparcV9FloatRegClass::colorIGNode(IGNode * Node,
       LR->setColor(  LR->getSuggestedColor() );
       return;
     } else if (DEBUG_RA)  {                 // can't allocate the suggested col
-      std::cerr << " Could NOT allocate the suggested color for LR ";
-      printSet(*LR); std::cerr << "\n";
+      std::cerr << " Could NOT allocate the suggested color for LR " << *LR
+                << "\n";
     }
   }