xref: /llvm-project/mlir/test/lib/Dialect/Test/TestAttributes.h (revision bc82793b304cff80605cf7ab14f51a7924d27481)
1 //===- TestTypes.h - MLIR Test Dialect 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 contains types defined by the TestDialect for testing various
10 // features of MLIR.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_TESTATTRIBUTES_H
15 #define MLIR_TESTATTRIBUTES_H
16 
17 #include <tuple>
18 
19 #include "TestTraits.h"
20 #include "mlir/Dialect/Polynomial/IR/PolynomialAttributes.h"
21 #include "mlir/Dialect/Utils/StructuredOpsUtils.h"
22 #include "mlir/IR/Attributes.h"
23 #include "mlir/IR/Diagnostics.h"
24 #include "mlir/IR/Dialect.h"
25 #include "mlir/IR/DialectImplementation.h"
26 
27 #include "TestAttrInterfaces.h.inc"
28 #include "TestOpEnums.h.inc"
29 #include "mlir/IR/DialectResourceBlobManager.h"
30 
31 namespace test {
32 class TestDialect;
33 // Payload class for the CopyCountAttr.
34 class CopyCount {
35 public:
CopyCount(std::string value)36   CopyCount(std::string value) : value(value) {}
37   CopyCount(const CopyCount &rhs);
38   CopyCount &operator=(const CopyCount &rhs);
39   CopyCount(CopyCount &&rhs) = default;
40   CopyCount &operator=(CopyCount &&rhs) = default;
41   static int counter;
42   std::string value;
43 };
44 llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
45                               const test::CopyCount &value);
46 
47 /// A handle used to reference external elements instances.
48 using TestDialectResourceBlobHandle =
49     mlir::DialectResourceBlobHandle<TestDialect>;
50 } // namespace test
51 
52 #define GET_ATTRDEF_CLASSES
53 #include "TestAttrDefs.h.inc"
54 
55 #endif // MLIR_TESTATTRIBUTES_H
56