This is an archive of the discontinued LLVM Phabricator instance.

[libTooling] Add `access` and `ifBound` combinators to Stencil library.
ClosedPublic

Authored by ymandel on Sep 16 2019, 2:01 PM.

Details

Summary

This revision add the access and ifBound combinators to the Stencil library:

  • access -- constructs an idiomatic expression for accessing a member (a MemberExpr).
  • ifBound -- chooses between two StencilParts based on the whether an id is bound in the match (corresponds to the combinator of the same name in RangeSelector).

Event Timeline

ymandel created this revision.Sep 16 2019, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2019, 2:01 PM
gribozavr accepted this revision.Sep 23 2019, 4:27 AM
gribozavr added inline comments.
clang/lib/Tooling/Refactoring/Stencil.cpp
70

I think for e = &e2 it will also produce e2.m... Maybe don't describe things in such detail.

"A stencil operation that builds a member access e.m or e->m as appropriate.

The expression is specified as a bound ID, the member is specified as a stencil."

I'm not even sure we need the second sentence.

198

These type aliases are only used once. Consider un-typealiasing.

This revision is now accepted and ready to land.Sep 23 2019, 4:27 AM
ymandel updated this revision to Diff 221312.Sep 23 2019, 5:54 AM

update to new signature for builders (Optional<string>)

ymandel updated this revision to Diff 221316.Sep 23 2019, 6:14 AM

addressed comments.

ymandel marked 3 inline comments as done.Sep 23 2019, 6:15 AM

Thanks for the review!

clang/lib/Tooling/Refactoring/Stencil.cpp
198

Removed all of the aliases.

This revision was automatically updated to reflect the committed changes.
ymandel marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 6:22 AM