diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-20 23:39:06 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-20 23:39:06 +0000 |
commit | 309856ae9f8c7c451d1ae93290119adae1d2fa6e (patch) | |
tree | 12404f29a03dd01a7dad051321f089d311aa0282 /clang/lib/AST/DeclPrinter.cpp | |
parent | d8561f058d8c3497dd7a98dbffcd30b0d4be22b0 (diff) | |
download | bcm5719-llvm-309856ae9f8c7c451d1ae93290119adae1d2fa6e.tar.gz bcm5719-llvm-309856ae9f8c7c451d1ae93290119adae1d2fa6e.zip |
DeclPrinter: add terse output mode and lots of tests
Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter. The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.
Also add many tests for DeclPrinter. There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.
llvm-svn: 162245
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 7f47604dece..303031cd649 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -220,6 +220,9 @@ void DeclPrinter::Print(AccessSpecifier AS) { //---------------------------------------------------------------------------- void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { + if (Policy.DontRecurseInDeclContext) + return; + if (Indent) Indentation += Policy.Indentation; |