[llvm-commits] [llvm] r79797 - in /llvm/trunk/lib/CodeGen/AsmPrinter: AsmPrinter.cpp DwarfDebug.cpp

Chris Lattner sabre at nondot.org
Sat Aug 22 17:51:00 PDT 2009


Author: lattner
Date: Sat Aug 22 19:51:00 2009
New Revision: 79797

URL: http://llvm.org/viewvc/llvm-project?rev=79797&view=rev
Log:
remove some random indentation stuff, yay for efficiency.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=79797&r1=79796&r2=79797&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Sat Aug 22 19:51:00 2009
@@ -1774,19 +1774,6 @@
   }
 }
 
-/// 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 @@
     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 @@
         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();
       }

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=79797&r1=79796&r2=79797&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Aug 22 19:51:00 2009
@@ -183,10 +183,10 @@
 
 #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;
 





More information about the llvm-commits mailing list