diff options
author | Zachary Turner <zturner@google.com> | 2018-11-05 17:40:28 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-11-05 17:40:28 +0000 |
commit | 4911023fe3fd3a142d1077149fc3bcd9948dece8 (patch) | |
tree | 84ff1d143fe3fc2a15b0f7655559872001ef6cee /lldb/source/Symbol/ClangASTContext.cpp | |
parent | 7509880b54fd47ae498cbbcd85293aebd9b00fa4 (diff) | |
download | bcm5719-llvm-4911023fe3fd3a142d1077149fc3bcd9948dece8.tar.gz bcm5719-llvm-4911023fe3fd3a142d1077149fc3bcd9948dece8.zip |
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
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index fe482dc4fb3..ab378cd8cff 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1285,7 +1285,7 @@ CompilerType ClangASTContext::GetCStringType(bool is_const) { return CompilerType(ast, ast->getPointerType(char_type)); } -clang::DeclContext * +clang::TranslationUnitDecl * ClangASTContext::GetTranslationUnitDecl(clang::ASTContext *ast) { return ast->getTranslationUnitDecl(); } @@ -8965,6 +8965,11 @@ ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, //---------------------------------------------------------------------- #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, |