This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Tighten access of RewritePattern methods.
ClosedPublic

Authored by csigg on Dec 4 2020, 10:18 AM.

Details

Summary

In RewritePattern, only expose matchAndRewrite as a public function. match can be protected (but needs to be protected because we want to call it from an override of matchAndRewrite). rewrite can be private.

For classes deriving from RewritePattern, all 3 functions can be private.

Side note: I didn't understand the need for the using RewritePattern::matchAndRewrite in derived classes, and started poking around. They are gone now, and I think the result is (only very slightly) cleaner.

Diff Detail

Event Timeline

csigg created this revision.Dec 4 2020, 10:18 AM
csigg requested review of this revision.Dec 4 2020, 10:18 AM

Can you clarify what this means in the description?

csigg retitled this revision from [mlir] Tighten scopes of RewritePattern methods. to [mlir] Tighten access of RewritePattern methods..Dec 4 2020, 11:47 AM
csigg edited the summary of this revision. (Show Details)
ftynse accepted this revision.Dec 7 2020, 1:42 AM
This revision is now accepted and ready to land.Dec 7 2020, 1:42 AM
This revision was automatically updated to reflect the committed changes.