mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-13 06:18:55 +00:00
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user