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