blob: 75007a0898bdddfdda788ef8c724e3b71e2807a5 [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),
Ruchira Sasanka0e62aa62001-10-19 21:39:31 +00005 AdjList(),
Ruchira Sasanka8e604792001-09-14 21:18:34 +00006 ParentLR(PLR)
7{
8 OnStack = false;
9 CurDegree = -1 ;
10 ParentLR->setUserIGNode( this );
11}
12
13
14
15void 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
24void 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}