This PR massively reorganizes the Test dialect's source files. It moves manually-written op hooks into `TestOpDefs.cpp`, moves format custom directive parsers and printers into `TestFormatUtils`, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR.
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
//===- TestInterfaces.h - MLIR interfaces for testing -----------*- 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 declares interfaces for the 'test' dialect that can be used for
|
|
// testing the interface infrastructure.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_TEST_LIB_DIALECT_TEST_TESTINTERFACES_H
|
|
#define MLIR_TEST_LIB_DIALECT_TEST_TESTINTERFACES_H
|
|
|
|
#include "mlir/Interfaces/SideEffectInterfaces.h"
|
|
|
|
namespace mlir {
|
|
namespace TestEffects {
|
|
struct Effect : public SideEffects::Effect {
|
|
using SideEffects::Effect::Effect;
|
|
|
|
template <typename Derived>
|
|
using Base = SideEffects::Effect::Base<Derived, Effect>;
|
|
|
|
static bool classof(const SideEffects::Effect *effect);
|
|
};
|
|
|
|
using EffectInstance = SideEffects::EffectInstance<Effect>;
|
|
|
|
struct Concrete : public Effect::Base<Concrete> {};
|
|
|
|
} // namespace TestEffects
|
|
} // namespace mlir
|
|
|
|
#include "TestOpInterfaces.h.inc"
|
|
|
|
#endif // MLIR_TEST_LIB_DIALECT_TEST_TESTINTERFACES_H
|