summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-21 09:12:06 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-21 09:12:06 +0000
commit671f45e701d6a3e3ad8623047b99bfc12a466b3a (patch)
treef842ebdd4d094a799618ae24d4e6b9001f476721 /clang/lib/AST
parent1110dc06a8437ca55629fbe50972c4d5e4bb505b (diff)
downloadbcm5719-llvm-671f45e701d6a3e3ad8623047b99bfc12a466b3a.tar.gz
bcm5719-llvm-671f45e701d6a3e3ad8623047b99bfc12a466b3a.zip
DeclPrinter: Indent access specifiers.
llvm-svn: 89552
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 131de8b2e11..864f1145a07 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -30,7 +30,8 @@ namespace {
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 @@ void Decl::dump() const {
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 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) {
AccessSpecifier AS = D->getAccess();
if (AS != CurAS) {
+ if (Indent)
+ this->Indent(Indentation - Policy.Indentation);
Print(AS);
Out << ":\n";
CurAS = AS;
OpenPOWER on IntegriCloud