1 #include "llvm/CodeGen/IGNode.h"
6 //-----------------------------------------------------------------------------
8 //-----------------------------------------------------------------------------
9 IGNode::IGNode(LiveRange *const PLR, unsigned int Ind) : Index(Ind),
14 ParentLR->setUserIGNode( this );
18 //-----------------------------------------------------------------------------
19 // Sets this IGNode on stack and reduce the degree of neighbors
20 //-----------------------------------------------------------------------------
21 void IGNode::pushOnStack()
24 int neighs = AdjList.size();
27 cerr << "\nAdj List size = " << neighs;
28 assert(0 && "Invalid adj list size");
31 for(int i=0; i < neighs; i++)
32 AdjList[i]->decCurDegree();
35 //-----------------------------------------------------------------------------
36 // Deletes an adjacency node. IGNodes are deleted when coalescing merges
37 // two IGNodes together.
38 //-----------------------------------------------------------------------------
39 void IGNode::delAdjIGNode(const IGNode *const Node) {
40 std::vector<IGNode *>::iterator It =
41 find(AdjList.begin(), AdjList.end(), Node);
42 assert( It != AdjList.end() ); // the node must be there