Added code to PhyRegAlloc to mark unusable suggested regs
[oota-llvm.git] / lib / Target / SparcV9 / RegAlloc / IGNode.cpp
1 #include "llvm/CodeGen/IGNode.h"
2
3
4 IGNode::IGNode(LiveRange *const PLR, unsigned int Ind): Index(Ind),
5                                                         AdjList(),
6                                                         ParentLR(PLR)
7 {
8   OnStack = false;
9   CurDegree = -1 ;
10   ParentLR->setUserIGNode( this );
11 }
12
13
14
15 void IGNode::pushOnStack()            // sets on to stack and 
16 {                                     // reduce the degree of neighbors  
17   OnStack = true; 
18   unsigned int neighs = AdjList.size();
19
20   for(unsigned int i=0; i < neighs; i++)  (AdjList[i])->decCurDegree();
21 }
22  
23
24 void IGNode::delAdjIGNode(const IGNode *const Node) {
25   vector <IGNode *>::iterator It = AdjList.begin();
26     
27   // find Node
28   for( ; It != AdjList.end() && (*It != Node); It++ ) ;
29   assert( It != AdjList.end() );      // the node must be there
30   
31   AdjList.erase( It );
32 }