This is an archive of the discontinued LLVM Phabricator instance.

[AST Matchers] Restrict `optionally` matcher to a single argument.
ClosedPublic

Authored by ymandel on Mar 3 2020, 12:09 PM.

Details

Summary

Currently, optionally can take multiple arguments, which commits it to a
particular strategy for those arguments (in this case, "for each"). We limit the
matcher to a single argument, which avoids any potential confusion and
simplifies the implementation. The user can retrieve multiple-argument
optionality, by explicitly using the desired operator (like forEach, anyOf,
allOf, etc.) with all children wrapped in optionally.

Diff Detail

Event Timeline

ymandel created this revision.Mar 3 2020, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2020, 12:09 PM
ymandel updated this revision to Diff 248170.Mar 4 2020, 6:55 AM

Updated comments for matcher.

ymandel updated this revision to Diff 248171.Mar 4 2020, 7:04 AM

Updated the matcher HTML doc.

Harbormaster completed remote builds in B48044: Diff 248170.
aaron.ballman accepted this revision.Mar 5 2020, 10:28 AM

LGTM, thank you!

This revision is now accepted and ready to land.Mar 5 2020, 10:28 AM
This revision was automatically updated to reflect the committed changes.