Skip to content

Commit 105c8c3

Browse files
authored
[MLIR][NFC] Retire let constructor for EmitC (#133732)
`let constructor` is legacy (do not use in tree!) since the tableGen backend emits most of the glue logic to build a pass.
1 parent 558ce50 commit 105c8c3

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@
1414
namespace mlir {
1515
namespace emitc {
1616

17-
//===----------------------------------------------------------------------===//
18-
// Passes
19-
//===----------------------------------------------------------------------===//
20-
21-
/// Creates an instance of the C-style expressions forming pass.
22-
std::unique_ptr<Pass> createFormExpressionsPass();
17+
#define GEN_PASS_DECL_FORMEXPRESSIONSPASS
18+
#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"
2319

2420
//===----------------------------------------------------------------------===//
2521
// Registration

mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
include "mlir/Pass/PassBase.td"
1313

14-
def FormExpressions : Pass<"form-expressions"> {
14+
def FormExpressionsPass : Pass<"form-expressions"> {
1515
let summary = "Form C-style expressions from C-operator ops";
1616
let description = [{
1717
The pass wraps emitc ops modelling C operators in emitc.expression ops and
1818
then folds single-use expressions into their users where possible.
1919
}];
20-
let constructor = "mlir::emitc::createFormExpressionsPass()";
2120
let dependentDialects = ["emitc::EmitCDialect"];
2221
}
2322

mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace mlir {
2020
namespace emitc {
21-
#define GEN_PASS_DEF_FORMEXPRESSIONS
21+
#define GEN_PASS_DEF_FORMEXPRESSIONSPASS
2222
#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"
2323
} // namespace emitc
2424
} // namespace mlir
@@ -28,7 +28,7 @@ using namespace emitc;
2828

2929
namespace {
3030
struct FormExpressionsPass
31-
: public emitc::impl::FormExpressionsBase<FormExpressionsPass> {
31+
: public emitc::impl::FormExpressionsPassBase<FormExpressionsPass> {
3232
void runOnOperation() override {
3333
Operation *rootOp = getOperation();
3434
MLIRContext *context = rootOp->getContext();
@@ -56,7 +56,3 @@ struct FormExpressionsPass
5656
}
5757
};
5858
} // namespace
59-
60-
std::unique_ptr<Pass> mlir::emitc::createFormExpressionsPass() {
61-
return std::make_unique<FormExpressionsPass>();
62-
}

0 commit comments

Comments
 (0)