Skip to content

Commit 2956293

Browse files
committed
privatize the ConvertToLLVMPassInterface
1 parent 3bf2f34 commit 2956293

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

mlir/include/mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,42 +60,6 @@ void populateOpConvertToLLVMConversionPatterns(Operation *op,
6060
ConversionTarget &target,
6161
LLVMTypeConverter &typeConverter,
6262
RewritePatternSet &patterns);
63-
64-
/// Base class for creating the internal implementation of `convert-to-llvm`
65-
/// passes.
66-
class ConvertToLLVMPassInterface {
67-
public:
68-
ConvertToLLVMPassInterface(MLIRContext *context,
69-
ArrayRef<std::string> filterDialects);
70-
virtual ~ConvertToLLVMPassInterface() = default;
71-
72-
/// Get the dependent dialects used by `convert-to-llvm`.
73-
static void getDependentDialects(DialectRegistry &registry);
74-
75-
/// Initialize the internal state of the `convert-to-llvm` pass
76-
/// implementation. This method is invoked by `ConvertToLLVMPass::initialize`.
77-
/// This method returns whether the initialization process failed.
78-
virtual LogicalResult initialize() = 0;
79-
80-
/// Transform `op` to LLVM with the conversions available in the pass. The
81-
/// analysis manager can be used to query analyzes like `DataLayoutAnalysis`
82-
/// to further configure the conversion process. This method is invoked by
83-
/// `ConvertToLLVMPass::runOnOperation`. This method returns whether the
84-
/// transformation process failed.
85-
virtual LogicalResult transform(Operation *op,
86-
AnalysisManager manager) const = 0;
87-
88-
protected:
89-
/// Visit the `ConvertToLLVMPatternInterface` dialect interfaces and call
90-
/// `visitor` with each of the interfaces. If `filterDialects` is non-empty,
91-
/// then `visitor` is invoked only with the dialects in the `filterDialects`
92-
/// list.
93-
LogicalResult visitInterfaces(
94-
llvm::function_ref<void(ConvertToLLVMPatternInterface *)> visitor);
95-
MLIRContext *context;
96-
/// List of dialects names to use as filters.
97-
ArrayRef<std::string> filterDialects;
98-
};
9963
} // namespace mlir
10064

10165
#include "mlir/Conversion/ConvertToLLVM/ToLLVMAttrInterface.h.inc"

mlir/lib/Conversion/ConvertToLLVM/ConvertToLLVMPass.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,42 @@ namespace mlir {
2828
using namespace mlir;
2929

3030
namespace {
31+
/// Base class for creating the internal implementation of `convert-to-llvm`
32+
/// passes.
33+
class ConvertToLLVMPassInterface {
34+
public:
35+
ConvertToLLVMPassInterface(MLIRContext *context,
36+
ArrayRef<std::string> filterDialects);
37+
virtual ~ConvertToLLVMPassInterface() = default;
38+
39+
/// Get the dependent dialects used by `convert-to-llvm`.
40+
static void getDependentDialects(DialectRegistry &registry);
41+
42+
/// Initialize the internal state of the `convert-to-llvm` pass
43+
/// implementation. This method is invoked by `ConvertToLLVMPass::initialize`.
44+
/// This method returns whether the initialization process failed.
45+
virtual LogicalResult initialize() = 0;
46+
47+
/// Transform `op` to LLVM with the conversions available in the pass. The
48+
/// analysis manager can be used to query analyzes like `DataLayoutAnalysis`
49+
/// to further configure the conversion process. This method is invoked by
50+
/// `ConvertToLLVMPass::runOnOperation`. This method returns whether the
51+
/// transformation process failed.
52+
virtual LogicalResult transform(Operation *op,
53+
AnalysisManager manager) const = 0;
54+
55+
protected:
56+
/// Visit the `ConvertToLLVMPatternInterface` dialect interfaces and call
57+
/// `visitor` with each of the interfaces. If `filterDialects` is non-empty,
58+
/// then `visitor` is invoked only with the dialects in the `filterDialects`
59+
/// list.
60+
LogicalResult visitInterfaces(
61+
llvm::function_ref<void(ConvertToLLVMPatternInterface *)> visitor);
62+
MLIRContext *context;
63+
/// List of dialects names to use as filters.
64+
ArrayRef<std::string> filterDialects;
65+
};
66+
3167
/// This DialectExtension can be attached to the context, which will invoke the
3268
/// `apply()` method for every loaded dialect. If a dialect implements the
3369
/// `ConvertToLLVMPatternInterface` interface, we load dependent dialects

0 commit comments

Comments
 (0)