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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72590 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 821eb55..b24e912 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/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 @@
     /// 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 @@
     }
     
     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.