1 //===- TestTraits.h - MLIR Test Traits --------------------------*- 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 traits defined by the TestDialect. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef MLIR_TESTTRAITS_H 14 #define MLIR_TESTTRAITS_H 15 16 #include "mlir/IR/Attributes.h" 17 #include "mlir/IR/Types.h" 18 19 namespace mlir { 20 namespace TypeTrait { 21 22 /// A trait defined on types for testing purposes. 23 template <typename ConcreteType> 24 class TestTypeTrait : public TypeTrait::TraitBase<ConcreteType, TestTypeTrait> { 25 }; 26 27 } // namespace TypeTrait 28 29 namespace AttributeTrait { 30 31 /// A trait defined on attributes for testing purposes. 32 template <typename ConcreteType> 33 class TestAttrTrait 34 : public AttributeTrait::TraitBase<ConcreteType, TestAttrTrait> {}; 35 36 } // namespace AttributeTrait 37 } // namespace mlir 38 39 #endif // MLIR_TESTTRAITS_H 40