summaryrefslogtreecommitdiff
path: root/mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td
blob: 0e45711ae441c917cc3945f6ac5c3d9f773c4a65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===- IRDLInterfaces.td - IRDL Attributes -----------------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file declares the interfaces used by IRDL.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_DIALECT_IRDL_IR_IRDLINTERFACES
#define MLIR_DIALECT_IRDL_IR_IRDLINTERFACES

include "mlir/IR/OpBase.td"

def VerifyConstraintInterface : OpInterface<"VerifyConstraintInterface"> {
  let cppNamespace = "::mlir::irdl";

  let description = [{
    Interface to get an IRDL constraint verifier from an operation. 
  }];

  let methods = [
    InterfaceMethod<
      [{
        Get an instance of a constraint verifier for the associated operation."
        Returns `nullptr` upon failure.
      }],
      "std::unique_ptr<::mlir::irdl::Constraint>",
      "getVerifier",
      (ins "::mlir::SmallVector<Value> const&":$valueRes,
      "::mlir::DenseMap<::mlir::irdl::TypeOp, std::unique_ptr<::mlir::DynamicTypeDefinition>> &":$types,
      "::mlir::DenseMap<::mlir::irdl::AttributeOp, std::unique_ptr<::mlir::DynamicAttrDefinition>> &":$attrs)
    >
  ];
}

#endif // MLIR_DIALECT_IRDL_IR_IRDLINTERFACES