Skip to content

[MLIR][NFC] Retire let constructor for EmitC #133732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
namespace mlir {
namespace emitc {

//===----------------------------------------------------------------------===//
// Passes
//===----------------------------------------------------------------------===//

/// Creates an instance of the C-style expressions forming pass.
std::unique_ptr<Pass> createFormExpressionsPass();
#define GEN_PASS_DECL_FORMEXPRESSIONSPASS
#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"

//===----------------------------------------------------------------------===//
// Registration
Expand Down
3 changes: 1 addition & 2 deletions mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@

include "mlir/Pass/PassBase.td"

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

Expand Down
8 changes: 2 additions & 6 deletions mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace mlir {
namespace emitc {
#define GEN_PASS_DEF_FORMEXPRESSIONS
#define GEN_PASS_DEF_FORMEXPRESSIONSPASS
#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"
} // namespace emitc
} // namespace mlir
Expand All @@ -28,7 +28,7 @@ using namespace emitc;

namespace {
struct FormExpressionsPass
: public emitc::impl::FormExpressionsBase<FormExpressionsPass> {
: public emitc::impl::FormExpressionsPassBase<FormExpressionsPass> {
void runOnOperation() override {
Operation *rootOp = getOperation();
MLIRContext *context = rootOp->getContext();
Expand Down Expand Up @@ -56,7 +56,3 @@ struct FormExpressionsPass
}
};
} // namespace

std::unique_ptr<Pass> mlir::emitc::createFormExpressionsPass() {
return std::make_unique<FormExpressionsPass>();
}