[all-commits] [llvm/llvm-project] 88f25b: [mlir] Allow for using interface class name in ODS...

ftynse via All-commits all-commits at lists.llvm.org
Tue Nov 17 05:29:17 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 88f25bda1376b68631106c0e1c5cbe3f385204e0
      https://github.com/llvm/llvm-project/commit/88f25bda1376b68631106c0e1c5cbe3f385204e0
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M mlir/test/lib/Dialect/Test/TestInterfaces.td
    M mlir/test/lib/IR/TestInterfaces.cpp
    M mlir/test/mlir-tblgen/interfaces.mlir
    M mlir/test/mlir-tblgen/op-interface.td
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

  Log Message:
  -----------
  [mlir] Allow for using interface class name in ODS interface definitions

It may be necessary for interface methods to process or return variables with
the interface class type, in particular for attribute and type interfaces that
can return modified attributes and types that implement the same interface.
However, the code generated by ODS in this case would not compile because the
signature (and the body if provided) appear in the definition of the Model
class and before the interface class, which derives from the Model. Change the ODS
interface method generator to emit only method declarations in the Model class
itself, and emit method definitions after the interface class. Mark as "inline"
since their definitions are still emitted in the header and are no longer
implicitly inline. Add a forward declaration of the interface class before the
Concept+Model classes to make the class name usable in declarations.

Reviewed By: rriddle

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




More information about the All-commits mailing list