diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-10-23 18:02:47 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-10-23 18:02:47 +0000 |
commit | 28ba80e648610adf7ab114de5b087d8c1de61d3e (patch) | |
tree | 8a5eeee117cd9f465d63d3599d4b3ca8ad4bb1b2 /llvm/lib/CodeGen/RegAlloc/IGNode.cpp | |
parent | ad44de185d365ba7f2ba4208c6c5a16423b3afbd (diff) | |
download | bcm5719-llvm-28ba80e648610adf7ab114de5b087d8c1de61d3e.tar.gz bcm5719-llvm-28ba80e648610adf7ab114de5b087d8c1de61d3e.zip |
* Use C++ style comments instead of C-style
* Make file description more readable
* Make code layout more consistent, include comment in assert so it's visible
during execution if it hits
llvm-svn: 9430
Diffstat (limited to 'llvm/lib/CodeGen/RegAlloc/IGNode.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAlloc/IGNode.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/IGNode.cpp b/llvm/lib/CodeGen/RegAlloc/IGNode.cpp index fcd299b28c6..f883fb13c1d 100644 --- a/llvm/lib/CodeGen/RegAlloc/IGNode.cpp +++ b/llvm/lib/CodeGen/RegAlloc/IGNode.cpp @@ -7,7 +7,8 @@ // //===----------------------------------------------------------------------===// // -// class IGNode for coloring-based register allocation for LLVM. +// This file implements an Interference graph node for coloring-based register +// allocation. // //===----------------------------------------------------------------------===// @@ -28,7 +29,7 @@ void IGNode::pushOnStack() { assert(0 && "Invalid adj list size"); } - for(int i=0; i < neighs; i++) + for (int i=0; i < neighs; i++) AdjList[i]->decCurDegree(); } @@ -39,7 +40,7 @@ void IGNode::pushOnStack() { void IGNode::delAdjIGNode(const IGNode *Node) { std::vector<IGNode *>::iterator It=find(AdjList.begin(), AdjList.end(), Node); - assert( It != AdjList.end() ); // the node must be there + assert(It != AdjList.end() && "The node must be there!"); AdjList.erase(It); } @@ -48,13 +49,10 @@ void IGNode::delAdjIGNode(const IGNode *Node) { //----------------------------------------------------------------------------- unsigned -IGNode::getCombinedDegree(const IGNode* otherNode) const -{ +IGNode::getCombinedDegree(const IGNode* otherNode) const { std::vector<IGNode*> nbrs(AdjList); nbrs.insert(nbrs.end(), otherNode->AdjList.begin(), otherNode->AdjList.end()); sort(nbrs.begin(), nbrs.end()); std::vector<IGNode*>::iterator new_end = unique(nbrs.begin(), nbrs.end()); return new_end - nbrs.begin(); } - - |