This is an archive of the discontinued LLVM Phabricator instance.

Allow lldb-test to combine -find with -dump-clang-ast
ClosedPublic

Authored by aprantl on Apr 16 2020, 2:09 PM.

Details

Summary

This patch threads an lldb::DescriptionLevel through the typesystem to allow dumping the full Clang AST (level=verbose) of any lldb::Type in addition to the human-readable source description (default level=full). This type dumping interface is currently not exposed through the SBAPI.

The application is to let lldb-test dump the clang AST of search results. I need this to test lazy type completion of clang types in subsequent patches.

Diff Detail

Event Timeline

aprantl created this revision.Apr 16 2020, 2:09 PM
shafik added inline comments.Apr 16 2020, 3:38 PM
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
8823

Does it make sense to apply these change to non-objective-C cases?

lldb/tools/lldb-test/lldb-test.cpp
734–744

The relationship between DumpClangAST and Find is not obvious. Basically we are falling through here in the FindType::Type case.

Perhaps a comment here and maybe on the Map.Dump(&Stream, false, GetDescriptionLevel()); line might help clarify how these options are related.

aprantl updated this revision to Diff 258197.Apr 16 2020, 4:15 PM
aprantl marked 2 inline comments as done.

Address feedback from Shafik. Thanks!

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
8823

It does absolutely! I must admit I sort of forgot to update the other cases, because they weren't on my critical path. Done now.

lldb/tools/lldb-test/lldb-test.cpp
734–744

I added the explanation to the documentation of the -dump-clang-ast option.

shafik accepted this revision.Apr 17 2020, 9:36 AM

LGTM

Thank you! This looks like a nice update to the functionality.

This revision is now accepted and ready to land.Apr 17 2020, 9:36 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2020, 11:21 AM