Ruchira Sasanka | 8e60479 | 2001-09-14 21:18:34 +0000 | [diff] [blame] | 1 | #include "llvm/CodeGen/IGNode.h" |
| 2 | |
| 3 | |
| 4 | IGNode::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 | |
| 14 | void 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 | |
| 23 | void 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 | } |