[all-commits] [llvm/llvm-project] c0edce: Add a static assertions for custom Op<> to not def...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Tue Jun 8 11:38:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c0edcec630eb26e12d66dae2f0e1fbf5258cb6ac
      https://github.com/llvm/llvm-project/commit/c0edcec630eb26e12d66dae2f0e1fbf5258cb6ac
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-06-08 (Tue, 08 Jun 2021)

  Changed paths:
    M mlir/include/mlir/IR/OpDefinition.h

  Log Message:
  -----------
  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




More information about the All-commits mailing list