Add a target modules dump ast command.

This is useful for investigating the clang ast as you reconstruct
it via by parsing debug info.  It can also be used to write tests
against.

Differential Revision: https://reviews.llvm.org/D54072

llvm-svn: 346149
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index fe482dc..ab378cd 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1285,7 +1285,7 @@
   return CompilerType(ast, ast->getPointerType(char_type));
 }
 
-clang::DeclContext *
+clang::TranslationUnitDecl *
 ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) {
   return ast->getTranslationUnitDecl();
 }
@@ -8965,6 +8965,11 @@
 //----------------------------------------------------------------------
 #define DEPTH_INCREMENT 2
 
+void ClangASTContext::Dump(Stream &s) {
+  TranslationUnitDecl *tu = GetTranslationUnitDecl();
+  tu->dump(s.AsRawOstream());
+}
+
 void ClangASTContext::DumpValue(
     lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s,
     lldb::Format format, const DataExtractor &data,