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 | 49795ae2c7cbb0845ed07b6626ac24275234e3d1 (patch) | |
tree | a1f19dd5782b617671d058701db6b97ce1780128 /lib/AST/DeclPrinter.cpp | |
parent | d64c2eb83d7ec86faa4f2554935a977a19573f59 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclPrinter.cpp')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 7f47604dec..303031cd64 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/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; |