// RegClassArr.pushback( new SparcFloatCCRegClass(2) );
if(DEBUG_RA)
- cout << "Created machine register classes." << endl;
+ cerr << "Created machine register classes." << endl;
}
inline void printIGNodeList() const {
- cout << "IG Nodes for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG Nodes for Register Class " << RegClassID << ":" << endl;
IG.printIGNodeList();
}
inline void printIG() {
- cout << "IG for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG for Register Class " << RegClassID << ":" << endl;
IG.printIG();
}
assert(MInst);
if( DEBUG_LV > 1) { // debug msg
- cout << " *Iterating over machine instr ";
+ cerr << " *Iterating over machine instr ";
MInst->dump();
- cout << endl;
+ cerr << endl;
}
// iterate over MI operands to find defs
assert( PhiArgMap[ ArgVal ] );
if( DEBUG_LV > 1) { // debug msg of level 2
- cout << " - phi operand ";
+ cerr << " - phi operand ";
printValue( ArgVal );
- cout << " came from BB ";
+ cerr << " came from BB ";
printValue( PhiArgMap[ ArgVal ]);
- cout<<endl;
+ cerr<<endl;
}
} // if( IsPhi )
InSetChanged = true;
if( DEBUG_LV > 1) {
- cout << " +Def: "; printValue( Op ); cout << endl;
+ cerr << " +Def: "; printValue( Op ); cerr << endl;
}
}
InSetChanged = true;
if( DEBUG_LV > 1) { // debug msg of level 2
- cout << " Use: "; printValue( Op ); cout << endl;
+ cerr << " Use: "; printValue( Op ); cerr << endl;
}
}
void BBLiveVar::printAllSets() const
{
- cout << " Defs: "; DefSet.printSet(); cout << endl;
- cout << " In: "; InSet.printSet(); cout << endl;
- cout << " Out: "; OutSet.printSet(); cout << endl;
+ cerr << " Defs: "; DefSet.printSet(); cerr << endl;
+ cerr << " In: "; InSet.printSet(); cerr << endl;
+ cerr << " Out: "; OutSet.printSet(); cerr << endl;
}
void BBLiveVar::printInOutSets() const
{
- cout << " In: "; InSet.printSet(); cout << endl;
- cout << " Out: "; OutSet.printSet(); cout << endl;
+ cerr << " In: "; InSet.printSet(); cerr << endl;
+ cerr << " Out: "; OutSet.printSet(); cerr << endl;
}
const BasicBlock *BB = *BBI; // get the current BB
- if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
+ if(DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":" << endl; }
// create a new BBLiveVar
BBLiveVar * LVBB = new BBLiveVar( BB, POId );
bool ResultFlow, NeedAnotherIteration = false;
if(DEBUG_LV)
- cout << endl << " After Backward Pass ..." << endl;
+ cerr << endl << " After Backward Pass ..." << endl;
po_iterator<const Method*> BBI = po_begin(Meth);
BBLiveVar* LVBB = BB2BBLVMap[*BBI];
assert( LVBB );
- if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":" << endl;
- // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
+ if(DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":" << endl;
+ // cerr << " (POId=" << LVBB->getPOId() << ")" << endl ;
ResultFlow = false;
if (HasAnalyzed)
return;
- if( DEBUG_LV) cout << "Analysing live variables ..." << endl;
+ if( DEBUG_LV) cerr << "Analysing live variables ..." << endl;
// create and initialize all the BBLiveVars of the CFG
constructBBs();
HasAnalyzed = true; // finished analysing
- if( DEBUG_LV) cout << "Live Variable Analysis complete!" << endl;
+ if( DEBUG_LV) cerr << "Live Variable Analysis complete!" << endl;
}
void printValue( const Value *const v) // func to print a Value
{
- if( (*v).hasName() )
- cout << v << "(" << ((*v).getName()) << ") ";
+ if (v->hasName())
+ cerr << v << "(" << ((*v).getName()) << ") ";
else if (v->getValueType() == Value::ConstantVal) // if const
- cout << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") ";
+ cerr << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") ";
else
- cout << v << " ";
+ cerr << v << " ";
}
if(SuggestedColor == -1 )
SuggestedColor = Col;
else if (DEBUG_RA)
- cout << "Already has a suggested color " << Col << endl;
+ cerr << "Already has a suggested color " << Col << endl;
}
inline unsigned getSuggestedColor() const {
inline void printIGNodeList() const {
- cout << "IG Nodes for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG Nodes for Register Class " << RegClassID << ":" << endl;
IG.printIGNodeList();
}
inline void printIG() {
- cout << "IG for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG for Register Class " << RegClassID << ":" << endl;
IG.printIG();
}
assert(MInst);
if( DEBUG_LV > 1) { // debug msg
- cout << " *Iterating over machine instr ";
+ cerr << " *Iterating over machine instr ";
MInst->dump();
- cout << endl;
+ cerr << endl;
}
// iterate over MI operands to find defs
assert( PhiArgMap[ ArgVal ] );
if( DEBUG_LV > 1) { // debug msg of level 2
- cout << " - phi operand ";
+ cerr << " - phi operand ";
printValue( ArgVal );
- cout << " came from BB ";
+ cerr << " came from BB ";
printValue( PhiArgMap[ ArgVal ]);
- cout<<endl;
+ cerr<<endl;
}
} // if( IsPhi )
InSetChanged = true;
if( DEBUG_LV > 1) {
- cout << " +Def: "; printValue( Op ); cout << endl;
+ cerr << " +Def: "; printValue( Op ); cerr << endl;
}
}
InSetChanged = true;
if( DEBUG_LV > 1) { // debug msg of level 2
- cout << " Use: "; printValue( Op ); cout << endl;
+ cerr << " Use: "; printValue( Op ); cerr << endl;
}
}
void BBLiveVar::printAllSets() const
{
- cout << " Defs: "; DefSet.printSet(); cout << endl;
- cout << " In: "; InSet.printSet(); cout << endl;
- cout << " Out: "; OutSet.printSet(); cout << endl;
+ cerr << " Defs: "; DefSet.printSet(); cerr << endl;
+ cerr << " In: "; InSet.printSet(); cerr << endl;
+ cerr << " Out: "; OutSet.printSet(); cerr << endl;
}
void BBLiveVar::printInOutSets() const
{
- cout << " In: "; InSet.printSet(); cout << endl;
- cout << " Out: "; OutSet.printSet(); cout << endl;
+ cerr << " In: "; InSet.printSet(); cerr << endl;
+ cerr << " Out: "; OutSet.printSet(); cerr << endl;
}
const BasicBlock *BB = *BBI; // get the current BB
- if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
+ if(DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":" << endl; }
// create a new BBLiveVar
BBLiveVar * LVBB = new BBLiveVar( BB, POId );
bool ResultFlow, NeedAnotherIteration = false;
if(DEBUG_LV)
- cout << endl << " After Backward Pass ..." << endl;
+ cerr << endl << " After Backward Pass ..." << endl;
po_iterator<const Method*> BBI = po_begin(Meth);
BBLiveVar* LVBB = BB2BBLVMap[*BBI];
assert( LVBB );
- if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":" << endl;
- // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
+ if(DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":" << endl;
+ // cerr << " (POId=" << LVBB->getPOId() << ")" << endl ;
ResultFlow = false;
if (HasAnalyzed)
return;
- if( DEBUG_LV) cout << "Analysing live variables ..." << endl;
+ if( DEBUG_LV) cerr << "Analysing live variables ..." << endl;
// create and initialize all the BBLiveVars of the CFG
constructBBs();
HasAnalyzed = true; // finished analysing
- if( DEBUG_LV) cout << "Live Variable Analysis complete!" << endl;
+ if( DEBUG_LV) cerr << "Live Variable Analysis complete!" << endl;
}
void printValue( const Value *const v) // func to print a Value
{
- if( (*v).hasName() )
- cout << v << "(" << ((*v).getName()) << ") ";
+ if (v->hasName())
+ cerr << v << "(" << ((*v).getName()) << ") ";
else if (v->getValueType() == Value::ConstantVal) // if const
- cout << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") ";
+ cerr << v << "(" << ((ConstPoolVal *) v)->getStrValue() << ") ";
else
- cout << v << " ";
+ cerr << v << " ";
}
if(SuggestedColor == -1 )
SuggestedColor = Col;
else if (DEBUG_RA)
- cout << "Already has a suggested color " << Col << endl;
+ cerr << "Already has a suggested color " << Col << endl;
}
inline unsigned getSuggestedColor() const {
inline void printIGNodeList() const {
- cout << "IG Nodes for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG Nodes for Register Class " << RegClassID << ":" << endl;
IG.printIGNodeList();
}
inline void printIG() {
- cout << "IG for Register Class " << RegClassID << ":" << endl;
+ cerr << "IG for Register Class " << RegClassID << ":" << endl;
IG.printIG();
}