[Mlir-commits] [mlir] [mlir] Use bind_front in RemarkEngine. NFC. (PR #175818)

Jakub Kuderski llvmlistbot at llvm.org
Tue Jan 13 11:35:05 PST 2026


https://github.com/kuhar created https://github.com/llvm/llvm-project/pull/175818

Switch from C++11 `std::bind` to C++26 `bind_front` backported in https://github.com/llvm/llvm-project/pull/175056.

The former is an old design that predates lambdas and uses explicit placeholders. `bind_front` should produce a much smaller object (we only need one pointer).

>From 8b5c5a603b82dee23112155f8b70cee11a0a11c9 Mon Sep 17 00:00:00 2001
From: Jakub Kuderski <jakub at nod-labs.com>
Date: Tue, 13 Jan 2026 14:32:23 -0500
Subject: [PATCH] [mlir] Use bind_front in RemarkEngine. NFC.

---
 mlir/lib/IR/Remarks.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mlir/lib/IR/Remarks.cpp b/mlir/lib/IR/Remarks.cpp
index 4cce16b172d80..197cf421f9ba4 100644
--- a/mlir/lib/IR/Remarks.cpp
+++ b/mlir/lib/IR/Remarks.cpp
@@ -259,11 +259,9 @@ llvm::LogicalResult RemarkEngine::initialize(
     std::unique_ptr<MLIRRemarkStreamerBase> streamer,
     std::unique_ptr<RemarkEmittingPolicyBase> remarkEmittingPolicy,
     std::string *errMsg) {
-
   remarkStreamer = std::move(streamer);
 
-  auto reportFunc =
-      std::bind(&RemarkEngine::reportImpl, this, std::placeholders::_1);
+  auto reportFunc = llvm::bind_front<&RemarkEngine::reportImpl>(this);
   remarkEmittingPolicy->initialize(ReportFn(std::move(reportFunc)));
 
   this->remarkEmittingPolicy = std::move(remarkEmittingPolicy);



More information about the Mlir-commits mailing list