summaryrefslogtreecommitdiff
path: root/lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-01 20:05:47 +0000
committerChris Lattner <sabre@nondot.org>2003-09-01 20:05:47 +0000
commitc083dcccbf6da2830914ba691824cf780badef32 (patch)
treeb4088ef8a0883f5ec9ba627513c85ec8f9673351 /lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
parentbcc6dec741f8118da8459bc6ee76f1acf5a7e6ea (diff)
downloadllvm-c083dcccbf6da2830914ba691824cf780badef32.tar.gz
llvm-c083dcccbf6da2830914ba691824cf780badef32.tar.bz2
llvm-c083dcccbf6da2830914ba691824cf780badef32.tar.xz
Move IGNode from public include directory to here. Minor cleanups like adding std:: namespace qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp')
-rw-r--r--lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp45
1 files changed, 18 insertions, 27 deletions
diff --git a/lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp b/lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
index b246e60539..bc28ed47d4 100644
--- a/lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
+++ b/lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
@@ -6,7 +6,7 @@
#include "RegAllocCommon.h"
#include "InterferenceGraph.h"
-#include "llvm/CodeGen/IGNode.h"
+#include "IGNode.h"
#include "Support/STLExtras.h"
#include <algorithm>
using std::cerr;
@@ -22,22 +22,18 @@ inline static void assertIGNode(const InterferenceGraph *IG,
// The matrix is NOT yet created by the constructor. Call createGraph()
// to create it after adding all IGNodes to the IGNodeList.
//-----------------------------------------------------------------------------
-InterferenceGraph::InterferenceGraph(RegClass *const RC) : RegCl(RC),
- IGNodeList()
-{
+InterferenceGraph::InterferenceGraph(RegClass *const RC) : RegCl(RC) {
IG = NULL;
Size = 0;
- if( DEBUG_RA >= RA_DEBUG_Interference) {
- cerr << "Interference graph created!\n";
- }
+ if( DEBUG_RA >= RA_DEBUG_Interference)
+ std::cerr << "Interference graph created!\n";
}
//-----------------------------------------------------------------------------
// destructor. Deletes the bit matrix and all IGNodes
//-----------------------------------------------------------------------------
-InterferenceGraph:: ~InterferenceGraph() {
-
+InterferenceGraph:: ~InterferenceGraph() {
// delete the matrix
for(unsigned int r=0; r < IGNodeList.size(); ++r)
delete[] IG[r];
@@ -98,7 +94,7 @@ void InterferenceGraph::setInterference(const LiveRange *const LR1,
char *val;
if( DEBUG_RA >= RA_DEBUG_Interference)
- cerr << "setting intf for: [" << row << "][" << col << "]\n";
+ std::cerr << "setting intf for: [" << row << "][" << col << "]\n";
( row > col) ? val = &IG[row][col]: val = &IG[col][row];
@@ -152,9 +148,9 @@ void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *LR1,
assertIGNode(this, SrcNode);
if( DEBUG_RA >= RA_DEBUG_Interference) {
- cerr << "Merging LRs: \""; printSet(*LR1);
- cerr << "\" and \""; printSet(*LR2);
- cerr << "\"\n";
+ std::cerr << "Merging LRs: \""; printSet(*LR1);
+ std::cerr << "\" and \""; printSet(*LR2);
+ std::cerr << "\"\n";
}
unsigned SrcDegree = SrcNode->getNumOfNeighbors();
@@ -215,20 +211,16 @@ void InterferenceGraph::setCurDegreeOfIGNodes()
//----------------------------------------------------------------------------
// Print the IGnodes
//----------------------------------------------------------------------------
-void InterferenceGraph::printIG() const
-{
-
- for(unsigned int i=0; i < Size; i++) {
-
+void InterferenceGraph::printIG() const {
+ for(unsigned i=0; i < Size; i++) {
const IGNode *const Node = IGNodeList[i];
if(Node) {
- cerr << " [" << i << "] ";
+ std::cerr << " [" << i << "] ";
- for( unsigned int j=0; j < Size; j++) {
+ for( unsigned int j=0; j < Size; j++)
if(IG[i][j])
- cerr << "(" << i << "," << j << ") ";
- }
- cerr << "\n";
+ std::cerr << "(" << i << "," << j << ") ";
+ std::cerr << "\n";
}
}
}
@@ -236,16 +228,15 @@ void InterferenceGraph::printIG() const
//----------------------------------------------------------------------------
// Print the IGnodes in the IGNode List
//----------------------------------------------------------------------------
-void InterferenceGraph::printIGNodeList() const
-{
+void InterferenceGraph::printIGNodeList() const {
for(unsigned i=0; i < IGNodeList.size() ; ++i) {
const IGNode *const Node = IGNodeList[i];
if (Node) {
- cerr << " [" << Node->getIndex() << "] ";
+ std::cerr << " [" << Node->getIndex() << "] ";
printSet(*Node->getParentLR());
//int Deg = Node->getCurDegree();
- cerr << "\t <# of Neighs: " << Node->getNumOfNeighbors() << ">\n";
+ std::cerr << "\t <# of Neighs: " << Node->getNumOfNeighbors() << ">\n";
}
}
}