Apply clang-tidy fixes for performance-unnecessary-value-param in Utils.cpp (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Mon, 16 May 2022 10:09:28 +0000 (10:09 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 23 May 2022 23:12:58 +0000 (23:12 +0000)
mlir/include/mlir/Dialect/SCF/Utils/Utils.h
mlir/lib/Dialect/SCF/Utils/Utils.cpp

index 95df92e..09032cb 100644 (file)
@@ -54,7 +54,7 @@ using NewYieldValueFn = std::function<SmallVector<Value>(
     OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBBArgs)>;
 scf::ForOp replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
                                     ValueRange newIterOperands,
-                                    NewYieldValueFn newYieldValuesFn);
+                                    const NewYieldValueFn &newYieldValuesFn);
 
 /// Outline a region with a single block into a new FuncOp.
 /// Assumes the FuncOp result types is the type of the yielded operands of the
index d4c96e5..0910cb3 100644 (file)
@@ -36,9 +36,10 @@ struct LoopParams {
 };
 } // namespace
 
-scf::ForOp mlir::replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
-                                          ValueRange newIterOperands,
-                                          NewYieldValueFn newYieldValuesFn) {
+scf::ForOp
+mlir::replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
+                               ValueRange newIterOperands,
+                               const NewYieldValueFn &newYieldValuesFn) {
   // Create a new loop before the existing one, with the extra operands.
   OpBuilder::InsertionGuard g(builder);
   builder.setInsertionPoint(loop);