[Lldb-commits] [clang] [lldb] [lldb] Add filter option to AST dump command (PR #142164)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri May 30 08:16:21 PDT 2025


================
@@ -8511,8 +8512,16 @@ TypeSystemClang::dump(lldb::opaque_compiler_type_t type) const {
 }
 #endif
 
-void TypeSystemClang::Dump(llvm::raw_ostream &output) {
-  GetTranslationUnitDecl()->dump(output);
+void TypeSystemClang::Dump(llvm::raw_ostream &output,
+                           llvm::StringRef filter_string) {
+  auto consumer =
+      clang::CreateASTDumper(output /*Dump to stdout.*/, filter_string,
+                             /*DumpDecls=*/true,
+                             /*Deserialize=*/false,
+                             /*DumpLookups=*/false,
+                             /*DumpDeclTypes=*/false, clang::ADOF_Default);
+  lldbassert(consumer);
+  consumer->HandleTranslationUnit(*m_ast_up);
----------------
Michael137 wrote:

should probably assert on m_ast_up too

https://github.com/llvm/llvm-project/pull/142164


More information about the lldb-commits mailing list