MLIR  21.0.0git
ToEmitCInterface.h
Go to the documentation of this file.
1 //===- ToEmitCInterface.h - Conversion to EmitC iface ---*- 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 #ifndef MLIR_CONVERSION_CONVERTTOEMITC_TOEMITCINTERFACE_H
10 #define MLIR_CONVERSION_CONVERTTOEMITC_TOEMITCINTERFACE_H
11 
13 #include "mlir/IR/MLIRContext.h"
14 #include "mlir/IR/OpDefinition.h"
15 
16 namespace mlir {
17 class ConversionTarget;
18 class TypeConverter;
19 class MLIRContext;
20 class Operation;
21 class RewritePatternSet;
22 class AnalysisManager;
23 
25  : public DialectInterface::Base<ConvertToEmitCPatternInterface> {
26 public:
28 
29  /// Hook for derived dialect interface to provide conversion patterns
30  /// and mark dialect legal for the conversion target.
32  ConversionTarget &target, TypeConverter &typeConverter,
33  RewritePatternSet &patterns) const = 0;
34 };
35 
36 /// Recursively walk the IR and collect all dialects implementing the interface,
37 /// and populate the conversion patterns.
39  ConversionTarget &target,
40  TypeConverter &typeConverter,
42 
43 } // namespace mlir
44 
45 #endif // MLIR_CONVERSION_CONVERTTOEMITC_TOEMITCINTERFACE_H
This class describes a specific conversion target.
ConvertToEmitCPatternInterface(Dialect *dialect)
virtual void populateConvertToEmitCConversionPatterns(ConversionTarget &target, TypeConverter &typeConverter, RewritePatternSet &patterns) const =0
Hook for derived dialect interface to provide conversion patterns and mark dialect legal for the conv...
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
Definition: Dialect.h:38
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
Type conversion class.
The base class used for all derived interface types.
Include the generated interface declarations.
const FrozenRewritePatternSet & patterns
void populateConversionTargetFromOperation(Operation *op, ConversionTarget &target, TypeConverter &typeConverter, RewritePatternSet &patterns)
Recursively walk the IR and collect all dialects implementing the interface, and populate the convers...