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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jan 13 11:35:37 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-core

Author: Jakub Kuderski (kuhar)

<details>
<summary>Changes</summary>

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).

---
Full diff: https://github.com/llvm/llvm-project/pull/175818.diff


1 Files Affected:

- (modified) mlir/lib/IR/Remarks.cpp (+1-3) 


``````````diff
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);

``````````

</details>


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


More information about the Mlir-commits mailing list