[all-commits] [llvm/llvm-project] ff5696: Document CMake Changes Needed to Generate Attribut...

Maksim Levental via All-commits all-commits at lists.llvm.org
Tue Aug 15 14:30:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff5696cec96e7755d1a3ebb5fbbbfe7999c5386a
      https://github.com/llvm/llvm-project/commit/ff5696cec96e7755d1a3ebb5fbbbfe7999c5386a
  Author: max <maksim.levental at gmail.com>
  Date:   2023-08-15 (Tue, 15 Aug 2023)

  Changed paths:
    M mlir/docs/DefiningDialects/AttributesAndTypes.md

  Log Message:
  -----------
  Document CMake Changes Needed to Generate Attribute Code from TableGen

I've been struggling with generating the C++ class declarations and definitions for custom attributes from TableGen, as described on this documentation page: https://mlir.llvm.org/docs/DefiningDialects/AttributesAndTypes/#adding-a-new-attribute-or-type-definition

The code for custom types is automatically generated when the MLIR Dialect is added with `add_mlir_dialect()` in the CMake file.

The same is not the case for custom attributes. I think people could benefit from learning how to adjsut their CMakeLists.txt to automatically generate the classes as described on that documentation page. This change adds the necessary information for this.

makslevental on Discord was so kind to help me figure this out myself

Reviewed By: makslevental

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




More information about the All-commits mailing list