Output to cerr rather than cout so that debug info doesn't mess up assembly generation
llvm-svn: 840
diff --git a/llvm/lib/Target/Sparc/Sparc.cpp b/llvm/lib/Target/Sparc/Sparc.cpp
index e8835ae..9de9bc9 100644
--- a/llvm/lib/Target/Sparc/Sparc.cpp
+++ b/llvm/lib/Target/Sparc/Sparc.cpp
@@ -47,8 +47,8 @@
return;
if( DEBUG_RA ) {
- cout << endl << "******************** Method "<< (M)->getName();
- cout << " ********************" <<endl;
+ cerr << endl << "******************** Method "<< (M)->getName();
+ cerr << " ********************" <<endl;
}
MethodLiveVarInfo LVI(M ); // Analyze live varaibles
@@ -59,7 +59,7 @@
PRA.allocateRegisters();
- if( DEBUG_RA ) cout << endl << "Register allocation complete!" << endl;
+ if( DEBUG_RA ) cerr << endl << "Register allocation complete!" << endl;
}
diff --git a/llvm/lib/Target/Sparc/SparcInternals.h b/llvm/lib/Target/Sparc/SparcInternals.h
index ad0f17f..812378c 100644
--- a/llvm/lib/Target/Sparc/SparcInternals.h
+++ b/llvm/lib/Target/Sparc/SparcInternals.h
@@ -269,17 +269,14 @@
else if( ty <= Type::DoubleTyID)
res = FloatRegClassID; // sparc float reg class
else {
- cout << "TypeID: " << ty << endl;
+ cerr << "TypeID: " << ty << endl;
assert(0 && "Cannot resolve register class for type");
-
}
if(isCCReg)
return res + 2; // corresponidng condition code regiser
-
else
return res;
-
}
// returns the register tha contains always zero
diff --git a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
index 883ed52..ff01f35 100644
--- a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
@@ -43,8 +43,8 @@
return;
}
else { // can't allocate the suggested col
- cout << " Coud NOT allocate the suggested color for LR ";
- LR->printSet(); cout << endl;
+ cerr << " Could NOT allocate the suggested color for LR ";
+ LR->printSet(); cerr << endl;
}
}
@@ -193,8 +193,8 @@
return;
}
else { // can't allocate the suggested col
- cout << " Coud NOT allocate the suggested color for LR ";
- LR->printSet(); cout << endl;
+ cerr << " Could NOT allocate the suggested color for LR ";
+ LR->printSet(); cerr << endl;
}
}
diff --git a/llvm/lib/Target/Sparc/SparcRegInfo.cpp b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
index 15b1384..9d49f9c 100644
--- a/llvm/lib/Target/Sparc/SparcRegInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
@@ -102,7 +102,7 @@
else {
// Do NOTHING as this will be colored as a normal value.
- if (DEBUG_RA) cout << " Int Regr not suggested for method arg\n";
+ if (DEBUG_RA) cerr << " Int Regr not suggested for method arg\n";
}
}
@@ -288,8 +288,8 @@
// must be defined before
if( !LR ) {
if( DEBUG_RA) {
- cout << " ERROR: In call instr, no LR for arg: " ;
- printValue(CallArg); cout << endl;
+ cerr << " ERROR: In call instr, no LR for arg: " ;
+ printValue(CallArg); cerr << endl;
}
assert(0 && "NO LR for call arg");
// continue;
@@ -305,7 +305,7 @@
else if (DEBUG_RA)
// Do NOTHING as this will be colored as a normal value.
- cout << " Regr not suggested for int call arg" << endl;
+ cerr << " Regr not suggested for int call arg" << endl;
}
else if( RegType == FPSingleRegType && (argNo*2 +1)< NumOfFloatArgRegs)
@@ -357,9 +357,9 @@
LiveRange * RetValLR = LRI.getLiveRangeForValue( RetVal );
if( !RetValLR ) {
- cout << "\nNo LR for:";
+ cerr << "\nNo LR for:";
printValue( RetVal );
- cout << endl;
+ cerr << endl;
assert( RetValLR && "ERR:No LR for non-void return value");
//return;
}
@@ -449,8 +449,8 @@
// must be defined before
if( !LR ) {
if( DEBUG_RA) {
- cout << " ERROR: In call instr, no LR for arg: " ;
- printValue(CallArg); cout << endl;
+ cerr << " ERROR: In call instr, no LR for arg: " ;
+ printValue(CallArg); cerr << endl;
}
assert(0 && "NO LR for call arg");
// continue;
@@ -516,9 +516,9 @@
LiveRange *const LR = LRI.getLiveRangeForValue( RetVal );
if( !LR ) {
- cout << "\nNo LR for:";
+ cerr << "\nNo LR for:";
printValue( RetVal );
- cout << endl;
+ cerr << endl;
assert( LR && "No LR for return value of non-void method");
//return;
}
@@ -554,9 +554,9 @@
LiveRange *const LR = LRI.getLiveRangeForValue( RetVal );
if( ! LR ) {
- cout << "\nNo LR for:";
+ cerr << "\nNo LR for:";
printValue( RetVal );
- cout << endl;
+ cerr << endl;
// assert( LR && "No LR for return value of non-void method");
return;
}
@@ -684,7 +684,7 @@
break;
default:
- cout << "Value Type: " << Val->getValueType() << endl;
+ cerr << "Value Type: " << Val->getValueType() << endl;
assert(0 && "Unknown val type - Only constants/globals/labels are valid");
}
@@ -736,33 +736,26 @@
unsigned RegClassID = (LR->getRegClass())->getID();
- cout << " *Node " << (LR->getUserIGNode())->getIndex();
+ cerr << " *Node " << (LR->getUserIGNode())->getIndex();
if( ! LR->hasColor() ) {
- cout << " - could not find a color" << endl;
+ cerr << " - could not find a color" << endl;
return;
}
// if a color is found
- cout << " colored with color "<< LR->getColor();
+ cerr << " colored with color "<< LR->getColor();
if( RegClassID == IntRegClassID ) {
- cout<< " [" << SparcIntRegOrder::getRegName(LR->getColor()) ;
- cout << "]" << endl;
+ cerr<< " [" << SparcIntRegOrder::getRegName(LR->getColor()) ;
+ cerr << "]" << endl;
}
else if ( RegClassID == FloatRegClassID) {
- cout << "[" << SparcFloatRegOrder::getRegName(LR->getColor());
+ cerr << "[" << SparcFloatRegOrder::getRegName(LR->getColor());
if( LR->getTypeID() == Type::DoubleTyID )
- cout << "+" << SparcFloatRegOrder::getRegName(LR->getColor()+1);
- cout << "]" << endl;
+ cerr << "+" << SparcFloatRegOrder::getRegName(LR->getColor()+1);
+ cerr << "]" << endl;
}
-
-
}
-
-
-
-
-