[cfe-commits] r89552 - /cfe/trunk/lib/AST/DeclPrinter.cpp

Daniel Dunbar daniel at zuster.org
Sat Nov 21 01:12:06 PST 2009


Author: ddunbar
Date: Sat Nov 21 03:12:06 2009
New Revision: 89552

URL: http://llvm.org/viewvc/llvm-project?rev=89552&view=rev
Log:
DeclPrinter: Indent access specifiers.

Modified:
    cfe/trunk/lib/AST/DeclPrinter.cpp

Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=89552&r1=89551&r2=89552&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Sat Nov 21 03:12:06 2009
@@ -30,7 +30,8 @@
     PrintingPolicy Policy;
     unsigned Indentation;
 
-    llvm::raw_ostream& Indent();
+    llvm::raw_ostream& Indent() { return Indent(Indentation); }
+    llvm::raw_ostream& Indent(unsigned Indentation);
     void ProcessDeclGroup(llvm::SmallVectorImpl<Decl*>& Decls);
 
     void Print(AccessSpecifier AS);
@@ -154,8 +155,8 @@
   print(llvm::errs());
 }
 
-llvm::raw_ostream& DeclPrinter::Indent() {
-  for (unsigned i = 0; i < Indentation; ++i)
+llvm::raw_ostream& DeclPrinter::Indent(unsigned Indentation) {
+  for (unsigned i = 0; i != Indentation; ++i)
     Out << "  ";
   return Out;
 }
@@ -205,6 +206,8 @@
       AccessSpecifier AS = D->getAccess();
 
       if (AS != CurAS) {
+        if (Indent)
+          this->Indent(Indentation - Policy.Indentation);
         Print(AS);
         Out << ":\n";
         CurAS = AS;





More information about the cfe-commits mailing list