[Mlir-commits] [mlir] 1881d6f - Apply clang-tidy fixes for performance-unnecessary-copy-initialization in MathOps.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Apr 18 17:48:14 PDT 2022


Author: Mehdi Amini
Date: 2022-04-19T00:47:58Z
New Revision: 1881d6fc80ef6612400d5269d0f52da9d9ba7d38

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

LOG: Apply clang-tidy fixes for performance-unnecessary-copy-initialization in MathOps.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/Math/IR/MathOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Math/IR/MathOps.cpp b/mlir/lib/Dialect/Math/IR/MathOps.cpp
index 036d8d9423327..f14bb003deb5d 100644
--- a/mlir/lib/Dialect/Math/IR/MathOps.cpp
+++ b/mlir/lib/Dialect/Math/IR/MathOps.cpp
@@ -27,7 +27,7 @@ using namespace mlir::math;
 
 OpFoldResult math::AbsOp::fold(ArrayRef<Attribute> operands) {
   return constFoldUnaryOp<FloatAttr>(operands, [](const APFloat &a) {
-    APFloat result(a);
+    const APFloat &result(a);
     return abs(result);
   });
 }


        


More information about the Mlir-commits mailing list