HomePhabricator

Add a static assertions for custom Op<> to not defined data members (NFC)

Authored by mehdi_amini on Jun 8 2021, 11:28 AM.

Description

Add a static assertions for custom Op<> to not defined data members (NFC)

A common mistake for newcomers to MLIR is to try to store extra member
on the Op class. However these are intended to be thing wrapper around
an Operation*, all the storage is meant to be encoded in attribute on
the underlying Operation. This can be confusing to debug, so better
catch it at build time.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D103869