aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/lib/Dialect/Test/TestAttributes.h
blob: 778d84fae73656ec18feaf42f7d61afdf77543a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//===- TestTypes.h - MLIR Test Dialect Types --------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file contains types defined by the TestDialect for testing various
// features of MLIR.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_TESTATTRIBUTES_H
#define MLIR_TESTATTRIBUTES_H

#include <tuple>

#include "TestTraits.h"
#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/DialectResourceBlobManager.h"

// generated files require above includes to come first
#include "TestAttrInterfaces.h.inc"
#include "TestOpEnums.h.inc"

namespace test {
class TestDialect;
// Payload class for the CopyCountAttr.
class CopyCount {
public:
  CopyCount(std::string value) : value(value) {}
  CopyCount(const CopyCount &rhs);
  CopyCount &operator=(const CopyCount &rhs);
  CopyCount(CopyCount &&rhs) = default;
  CopyCount &operator=(CopyCount &&rhs) = default;
  static int counter;
  std::string value;
};
llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
                              const test::CopyCount &value);

/// A handle used to reference external elements instances.
using TestDialectResourceBlobHandle =
    mlir::DialectResourceBlobHandle<TestDialect>;
} // namespace test

#define GET_ATTRDEF_CLASSES
#include "TestAttrDefs.h.inc"

#endif // MLIR_TESTATTRIBUTES_H