diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-29 20:38:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-29 20:38:28 +0000 |
commit | 7de5966d76fea50cdf1ded7ccd2677594a12ef36 (patch) | |
tree | a823b08ce247d4b9447e707117392e469ee0936f /clang/lib/AST/StmtDumper.cpp | |
parent | 006459ecd4ab07c8a1daa2d005533649261f8c4a (diff) | |
download | bcm5719-llvm-7de5966d76fea50cdf1ded7ccd2677594a12ef36.tar.gz bcm5719-llvm-7de5966d76fea50cdf1ded7ccd2677594a12ef36.zip |
Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.
llvm-svn: 72590
Diffstat (limited to 'clang/lib/AST/StmtDumper.cpp')
-rw-r--r-- | clang/lib/AST/StmtDumper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index 821eb55c728..b24e912582d 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -15,6 +15,7 @@ #include "clang/AST/StmtVisitor.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/PrettyPrinter.h" #include "clang/Basic/SourceManager.h" #include "llvm/Support/Compiler.h" #include <cstdio> @@ -39,6 +40,8 @@ namespace { /// out so that we can print out deltas from then on out. const char *LastLocFilename; unsigned LastLocLine; + + PrintingPolicy Policy; public: StmtDumper(SourceManager *sm, FILE *f, unsigned maxDepth) : SM(sm), F(f), IndentLevel(0-1), MaxDepth(maxDepth) { @@ -223,7 +226,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { } std::string Name = VD->getNameAsString(); - VD->getType().getAsStringInternal(Name); + VD->getType().getAsStringInternal(Name, Policy); fprintf(F, "%s", Name.c_str()); // If this is a vardecl with an initializer, emit it. |