xref: /llvm-project/mlir/include/mlir/Dialect/PDL/IR/PDLTypes.h (revision ce57789d8e5dc109dc9bd330232b31a22a80ad3a)
1 //===- PDLTypes.h - Pattern Descriptor Language Types -----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the types for the Pattern Descriptor Language dialect.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_PDL_IR_PDLTYPES_H_
14 #define MLIR_DIALECT_PDL_IR_PDLTYPES_H_
15 
16 #include "mlir/IR/Types.h"
17 
18 //===----------------------------------------------------------------------===//
19 // PDL Dialect Types
20 //===----------------------------------------------------------------------===//
21 
22 namespace mlir {
23 namespace pdl {
24 /// This class represents the base class of all PDL types.
25 class PDLType : public Type {
26 public:
27   using Type::Type;
28 
29   static bool classof(Type type);
30 };
31 
32 /// If the given type is a range, return its element type, otherwise return
33 /// the type itself.
34 Type getRangeElementTypeOrSelf(Type type);
35 
36 } // namespace pdl
37 } // namespace mlir
38 
39 #define GET_TYPEDEF_CLASSES
40 #include "mlir/Dialect/PDL/IR/PDLOpsTypes.h.inc"
41 
42 #endif // MLIR_DIALECT_PDL_IR_PDLTYPES_H_
43