This is an archive of the discontinued LLVM Phabricator instance.

[libTooling] Add `describe` stencil for formatting AST nodes for diagnostics.
ClosedPublic

Authored by ymandel on Dec 4 2020, 7:25 AM.

Details

Summary

This new stencil combinator is intended for use in diagnostics and the like.

Diff Detail

Event Timeline

ymandel requested review of this revision.Dec 4 2020, 7:25 AM
ymandel created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 7:25 AM
ymandel updated this revision to Diff 309542.Dec 4 2020, 8:23 AM

renamed the combinator

ymandel retitled this revision from [libTooling] Add `formatNode` stencil for formatting AST nodes for diagnostics. to [libTooling] Add `nodeAsString` stencil for formatting AST nodes for diagnostics..Dec 4 2020, 8:24 AM
ymandel updated this revision to Diff 309590.Dec 4 2020, 11:16 AM

updated name, comments and tests.

ymandel retitled this revision from [libTooling] Add `nodeAsString` stencil for formatting AST nodes for diagnostics. to [libTooling] Add `describe` stencil for formatting AST nodes for diagnostics..Dec 4 2020, 11:17 AM
tdl-g accepted this revision.Dec 4 2020, 11:29 AM

Looks great, just one comment.

clang/unittests/Tooling/StencilTest.cpp
519

Can you add a comment (or a more detailed test name) explaining what this test case is validating?

This revision is now accepted and ready to land.Dec 4 2020, 11:29 AM

thanks!

clang/unittests/Tooling/StencilTest.cpp
519

It's the same pattern for (nearly) all of the StencilToStringTest cases. Might a comment on the fixture be a better place?

tdl-g added inline comments.Dec 4 2020, 12:07 PM
clang/unittests/Tooling/StencilTest.cpp
519

Oh, sorry, I thought the "repr" was a stencil combinator, I didn't realize it was part of the raw string quotation. My bad.

LGTM as is.

This revision was landed with ongoing or failed builds.Dec 7 2020, 8:08 AM
This revision was automatically updated to reflect the committed changes.