Skip to content

[lldb][TypeSystem] Enable colored AST dump #86159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ ClangExpressionParser::ClangExpressionParser(
// A value of 0 means no limit for both LLDB and Clang.
m_compiler->getDiagnostics().setErrorLimit(target_sp->GetExprErrorLimit());

// AST nodes will be dumped with color
m_compiler->getDiagnostics().setShowColors(true);

auto target_info = TargetInfo::CreateTargetInfo(
m_compiler->getDiagnostics(), m_compiler->getInvocation().TargetOpts);
if (log) {
Expand Down
3 changes: 3 additions & 0 deletions lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ void TypeSystemClang::CreateASTContext() {
m_diagnostic_consumer_up = std::make_unique<NullDiagnosticConsumer>();
m_ast_up->getDiagnostics().setClient(m_diagnostic_consumer_up.get(), false);

// AST nodes will be dumped with color
m_ast_up->getDiagnostics().setShowColors(true);

// This can be NULL if we don't know anything about the architecture or if
// the target for an architecture isn't enabled in the llvm/clang that we
// built
Expand Down