Big bug fix: getUsableUniRegAtMI needed to return values in arguments
[oota-llvm.git] / lib / Target / SparcV9 / RegAlloc / IGNode.cpp
1 #include "llvm/CodeGen/IGNode.h"
2 #include <algorithm>
3 #include <iostream>
4 using std::cerr;
5
6 //-----------------------------------------------------------------------------
7 // Sets this IGNode on stack and reduce the degree of neighbors  
8 //-----------------------------------------------------------------------------
9
10 void IGNode::pushOnStack() {
11   OnStack = true; 
12   int neighs = AdjList.size();
13
14   if (neighs < 0) {
15     cerr << "\nAdj List size = " << neighs;
16     assert(0 && "Invalid adj list size");
17   }
18
19   for(int i=0; i < neighs; i++)
20     AdjList[i]->decCurDegree();
21 }
22  
23 //-----------------------------------------------------------------------------
24 // Deletes an adjacency node. IGNodes are deleted when coalescing merges
25 // two IGNodes together.
26 //-----------------------------------------------------------------------------
27
28 void IGNode::delAdjIGNode(const IGNode *Node) {
29   std::vector<IGNode *>::iterator It=find(AdjList.begin(), AdjList.end(), Node);
30   assert( It != AdjList.end() );      // the node must be there
31   AdjList.erase(It);
32 }