From: Tom Eccles Date: Fri, 20 Jan 2023 12:51:11 +0000 (-0800) Subject: [mlir][Linalg] Fix ignoring nodiscard return value X-Git-Tag: upstream/17.0.6~20297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0d575310f2ee660dadfdaf1e06bac148a575754;p=platform%2Fupstream%2Fllvm.git [mlir][Linalg] Fix ignoring nodiscard return value ff94419a287c changed the return value of appendMangledType() to LogicalResult, which is marked as nodiscard. Ignoring the result generates a warning when building with clang. Reviewed By: nicolasvasilache, chelini Differential Revision: https://reviews.llvm.org/D142202 --- diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp index ebfb8ef..dc0b39a 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1803,14 +1803,16 @@ static LogicalResult appendMangledType(llvm::raw_string_ostream &ss, Type t) { ss << "sx"; else ss << size << "x"; - appendMangledType(ss, memref.getElementType()); + if (failed(appendMangledType(ss, memref.getElementType()))) + return failure(); return success(); } if (auto vec = t.dyn_cast()) { ss << "vector"; llvm::interleave( vec.getShape(), [&](int64_t i) { ss << i; }, [&]() { ss << "x"; }); - appendMangledType(ss, vec.getElementType()); + if (failed(appendMangledType(ss, vec.getElementType()))) + return failure(); return success(); } else if (t.isSignlessIntOrIndexOrFloat()) { ss << t;