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

source code of mlir/test/lib/Dialect/Test/TestAttributes.h