remove some random indentation stuff, yay for efficiency.
authorChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 00:51:00 +0000 (00:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 00:51:00 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79797 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 211f708c791ba6355832d1aff3020407be7d6f46..d2afe1e46dde38ad9cdf36d7e68f7342db04b1c8 100644 (file)
@@ -1774,19 +1774,6 @@ void AsmPrinter::EmitComments(const MCInst &MI) const
   }
 }
 
-/// 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.
 ///
@@ -1806,7 +1793,7 @@ static void PrintChildLoopComment(formatted_raw_ostream &O,
     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();
 
@@ -1858,7 +1845,7 @@ void AsmPrinter::EmitComments(const MachineBasicBlock &MBB) const
         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();
       }
index 358281045ffdc8b4411d877de952384b18028800..83a777220638ef506d8502cf53ff62bace116156 100644 (file)
@@ -183,10 +183,10 @@ public:
 
 #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;