}
}
-/// Indent - Insert spaces into the character output stream. The
-/// "level" is multiplied by the "scale" to calculate the number of
-/// spaces to insert. "level" can represent something like loop
-/// nesting level, for example.
-///
-static formatted_raw_ostream &
-Indent(formatted_raw_ostream &out, int level, int scale = 2) {
- for(int i = 0; i < level*scale; ++i) {
- out << " ";
- }
- return out;
-}
-
/// PrintChildLoopComment - Print comments about child loops within
/// the loop for this basic block, with nesting.
///
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString();
- Indent(O, (*cl)->getLoopDepth()-1)
+ O.indent(((*cl)->getLoopDepth()-1)*2)
<< " Child Loop BB" << FunctionNumber << "_"
<< Header->getNumber() << " Depth " << (*cl)->getLoopDepth();
O << '\n';
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString();
- Indent(O, CurLoop->getLoopDepth()-1)
+ O.indent((CurLoop->getLoopDepth()-1)*2)
<< " Inside Loop BB" << getFunctionNumber() << "_"
<< Header->getNumber() << " Depth " << CurLoop->getLoopDepth();
}
#ifndef NDEBUG
void DbgScope::dump() const {
- std::string Indent(IndentLevel, ' ');
-
- cerr << Indent; Desc.dump();
- cerr << " [" << StartLabelID << ", " << EndLabelID << "]\n";
+ raw_ostream &err = errs();
+ err.indent(IndentLevel);
+ Desc.dump();
+ err << " [" << StartLabelID << ", " << EndLabelID << "]\n";
IndentLevel += 2;