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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jan 13 11:44:57 PST 2026


Author: Jakub Kuderski
Date: 2026-01-13T14:44:53-05:00
New Revision: bf5ee0678e39560148a3ce658d7b34a09b7971fb

URL: https://github.com/llvm/llvm-project/commit/bf5ee0678e39560148a3ce658d7b34a09b7971fb
DIFF: https://github.com/llvm/llvm-project/commit/bf5ee0678e39560148a3ce658d7b34a09b7971fb.diff

LOG: [mlir] Use bind_front in RemarkEngine. NFC. (#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).

Added: 
    

Modified: 
    mlir/lib/IR/Remarks.cpp

Removed: 
    


################################################################################
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