This is an archive of the discontinued LLVM Phabricator instance.

[Tooling] Add a hack to work around issues with matcher binding in r368681.
ClosedPublic

Authored by dlj on Aug 14 2019, 9:03 PM.

Details

Summary

The change in r368681 contains a (probably unintentional) behavioral change for
rewrite rules with a single matcher. Previously, the single matcher would not
need to be bound (joinCaseMatchers returned it directly), even though a final
DynTypeMatcher was created and bound by buildMatcher. With the new change, a
single matcher will be bound, in addition to the final binding (which is now in
buildMatchers, but happens roughly at the same point in the overall flow).

This patch simply duplicates the "final matcher" trick: it creates an extra
DynTypedMatcher for each rewrite rule case matcher, and unconditionally makes it
bindable. This is probably not the right long-term fix, but it does allow
existing code to continue to work with this interface.

Diff Detail

Repository
rL LLVM

Event Timeline

dlj created this revision.Aug 14 2019, 9:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2019, 9:03 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision was not accepted when it landed; it landed in state Needs Review.Aug 14 2019, 9:12 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2019, 9:12 PM