Page MenuHomePhabricator

[mlir] DialectConversion: remove vtable from TypeConverter
ClosedPublic

Authored by ftynse on Jun 2 2020, 4:35 AM.

Details

Summary

The original design of TypeConverter expected specific converters to derive the
class and override virtual functions for conversions and materializations. This
did not scale well to multi-dialect conversions, so the design was changed to
register a list of converter and materializer functions, removing the need for
virtual functions. The only remaining virtual function, convertSignatureArg
is never overridden in-tree. Make it non-virtual, drop the virtual destructor
and thus remove vtable from TypeConverter.

If there exist TypeConverter users that need custom convertSignatureArg
behavior, it should be implemented using the callback registration mechanism
similar to that of conversions and materializations.

Depends On D79729

Diff Detail

Event Timeline

ftynse created this revision.Jun 2 2020, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2020, 4:36 AM
rriddle accepted this revision.Jun 2 2020, 9:00 AM
This revision is now accepted and ready to land.Jun 2 2020, 9:00 AM
rriddle added inline comments.Jun 2 2020, 9:00 AM
mlir/include/mlir/Transforms/DialectConversion.h
157

nit: hook -> method?

ftynse marked an inline comment as done.Jun 3 2020, 6:30 AM
This revision was automatically updated to reflect the committed changes.