Add a new -ast-dump-full option that traverses the translation unit
declaration rather than printing through the HandleTopLevelDecl
action. Using this, one can deserialize an entire PCH file and dump
it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70108 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index af8b5b6..ab72d6b 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -183,6 +183,8 @@
   EmitHTML,                     // Translate input source into HTML.
   ASTPrint,                     // Parse ASTs and print them.
   ASTDump,                      // Parse ASTs and dump them.
+  ASTDumpFull,                  // Parse ASTs and dump them, including the 
+                                // contents of a PCH file.
   ASTView,                      // Parse ASTs and view them in Graphviz.
   PrintDeclContext,             // Print DeclContext and their Decls.
   ParsePrintCallbacks,          // Parse and print each callback.
@@ -224,6 +226,8 @@
                         "Build ASTs and then pretty-print them"),
              clEnumValN(ASTDump, "ast-dump",
                         "Build ASTs and then debug dump them"),
+             clEnumValN(ASTDumpFull, "ast-dump-full",
+                        "Build ASTs and then debug dump them, including PCH"),
              clEnumValN(ASTView, "ast-view",
                         "Build ASTs and view them with GraphViz"),
              clEnumValN(PrintDeclContext, "print-decl-contexts",
@@ -1539,7 +1543,10 @@
     return CreateASTPrinter();
     
   case ASTDump:
-    return CreateASTDumper();
+    return CreateASTDumper(false);
+
+  case ASTDumpFull:
+    return CreateASTDumper(true);
     
   case ASTView:
     return CreateASTViewer();