[Mlir-commits] [mlir] [mlir][llvm] Fix attribute printer warning (PR #74351)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Dec 4 09:48:59 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Tobias Gysi (gysit)
<details>
<summary>Changes</summary>
This commit fixes a compilation warning caused by the printExpressionArg that returns LogicalResult instead of void.
The warning has been introduce by commit 6da578c.
---
Full diff: https://github.com/llvm/llvm-project/pull/74351.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp (+4-5)
``````````diff
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
index 053524679ece7..e2342670508ce 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
@@ -31,8 +31,8 @@ static LogicalResult parseExpressionArg(AsmParser &parser, uint64_t opcode,
/// Prints DWARF expression arguments with respect to the specific DWARF
/// operation. Some operands are printed in their textual form.
-static LogicalResult printExpressionArg(AsmPrinter &printer, uint64_t opcode,
- ArrayRef<uint64_t> args);
+static void printExpressionArg(AsmPrinter &printer, uint64_t opcode,
+ ArrayRef<uint64_t> args);
#include "mlir/Dialect/LLVMIR/LLVMOpsEnums.cpp.inc"
#define GET_ATTRDEF_CLASSES
@@ -166,8 +166,8 @@ LogicalResult parseExpressionArg(AsmParser &parser, uint64_t opcode,
return parser.parseCommaSeparatedList(operandParser);
}
-LogicalResult printExpressionArg(AsmPrinter &printer, uint64_t opcode,
- ArrayRef<uint64_t> args) {
+void printExpressionArg(AsmPrinter &printer, uint64_t opcode,
+ ArrayRef<uint64_t> args) {
size_t i = 0;
llvm::interleaveComma(args, printer, [&](uint64_t operand) {
if (i > 0 && opcode == llvm::dwarf::DW_OP_LLVM_convert) {
@@ -182,5 +182,4 @@ LogicalResult printExpressionArg(AsmPrinter &printer, uint64_t opcode,
printer << operand;
i++;
});
- return success();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/74351
More information about the Mlir-commits
mailing list