This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Remove lldb's own ASTDumper
ClosedPublic

Authored by teemperor on Nov 25 2019, 3:05 AM.

Details

Summary

LLDB's ASTDumper is just a clone of Clang's ASTDumper but with some scary code and
some unrelated functionality (like dumping name/attributes of types). This removes LLDB's ASTDumper
and replaces its uses with the ClangUtils::DumpDecl method that just calls Clang's ASTDumper
and returns the result as a string.

The few uses where we just want a textual representation of a type (which will print their name/attributes but not
dump any AST) are now also in ClangUtil under a ToString name until we find a better home for them.

Diff Detail

Event Timeline

teemperor created this revision.Nov 25 2019, 3:05 AM
labath accepted this revision.Nov 25 2019, 4:22 AM

Yay

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
1675

drop .c_str()

1709

drop .GetCString()

1762

drop .c_str()

This revision is now accepted and ready to land.Nov 25 2019, 4:22 AM
teemperor updated this revision to Diff 230875.Nov 25 2019, 4:27 AM
  • Address feedback (Thanks Pavel)
This revision was automatically updated to reflect the committed changes.
shafik added a subscriber: shafik.Dec 3 2019, 4:42 PM

Yeah, there was indeed some ugly code there, nice work!

lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.h