Skip to content

[mlir][llvm] Fix attribute printer warning #74351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

gysit
Copy link
Contributor

@gysit gysit commented Dec 4, 2023

This commit fixes a compilation warning caused by the printExpressionArg that returns LogicalResult instead of void.

The warning has been introduce by commit 6da578c.

This commit fixes a compilation warning caused by the
printExpressionArg that returns LogicalResult instead of void.

The warning has been introduce by commit 6da578c.
@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2023

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir

Author: Tobias Gysi (gysit)

Changes

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 --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();
 }

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes my issue. Thanks for the the quick fix!

@gysit gysit merged commit 7858071 into llvm:main Dec 4, 2023
@gysit gysit deleted the fix-expression-arg-printer branch December 4, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants