| 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/Ptr/IR/MemorySpaceInterfaces.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 | #include "mlir/IR/DialectResourceBlobManager.h" |
| 27 | |
| 28 | // generated files require above includes to come first |
| 29 | #include "TestAttrInterfaces.h.inc" |
| 30 | #include "TestOpEnums.h.inc" |
| 31 | |
| 32 | namespace test { |
| 33 | class TestDialect; |
| 34 | // Payload class for the CopyCountAttr. |
| 35 | class CopyCount { |
| 36 | public: |
| 37 | CopyCount(std::string value) : value(value) {} |
| 38 | CopyCount(const CopyCount &rhs); |
| 39 | CopyCount &operator=(const CopyCount &rhs); |
| 40 | CopyCount(CopyCount &&rhs) = default; |
| 41 | CopyCount &operator=(CopyCount &&rhs) = default; |
| 42 | static int counter; |
| 43 | std::string value; |
| 44 | }; |
| 45 | llvm::raw_ostream &operator<<(llvm::raw_ostream &os, |
| 46 | const test::CopyCount &value); |
| 47 | |
| 48 | /// A handle used to reference external elements instances. |
| 49 | using TestDialectResourceBlobHandle = |
| 50 | mlir::DialectResourceBlobHandle<TestDialect>; |
| 51 | } // namespace test |
| 52 | |
| 53 | #define GET_ATTRDEF_CLASSES |
| 54 | #include "TestAttrDefs.h.inc" |
| 55 | |
| 56 | #endif // MLIR_TESTATTRIBUTES_H |
| 57 |
