[TableGen] Add TreePatternNode::children and use it in for loops (NFC) (#119877)
[llvm-project.git] / mlir / test / lib / Dialect / Test / TestAttributes.h
blob7099bcf31729483224212fd6127c568f97698177
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef MLIR_TESTATTRIBUTES_H
15 #define MLIR_TESTATTRIBUTES_H
17 #include <tuple>
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"
27 #include "TestAttrInterfaces.h.inc"
28 #include "TestOpEnums.h.inc"
29 #include "mlir/IR/DialectResourceBlobManager.h"
31 namespace test {
32 class TestDialect;
33 // Payload class for the CopyCountAttr.
34 class CopyCount {
35 public:
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;
44 llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
45 const test::CopyCount &value);
47 /// A handle used to reference external elements instances.
48 using TestDialectResourceBlobHandle =
49 mlir::DialectResourceBlobHandle<TestDialect>;
50 } // namespace test
52 #define GET_ATTRDEF_CLASSES
53 #include "TestAttrDefs.h.inc"
55 #endif // MLIR_TESTATTRIBUTES_H