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