[Mlir-commits] [mlir] c7a7a43 - [mlir] Fix unused variable warning. (NFC)

Jacques Pienaar llvmlistbot at llvm.org
Fri Nov 3 15:50:57 PDT 2023


Author: Jacques Pienaar
Date: 2023-11-03T15:50:49-07:00
New Revision: c7a7a43dbb42af725979856f7e922149b7b594fa

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

LOG: [mlir] Fix unused variable warning. (NFC)

Not used in all cases. Shown by python test ops.

Added: 
    

Modified: 
    mlir/tools/mlir-tblgen/OpFormatGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index 18ca34379a71a0e..8553920f7713c11 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1415,7 +1415,8 @@ void OperationFormat::genElementParser(FormatElement *element, MethodBody &body,
   } else if (auto *customDir = dyn_cast<CustomDirective>(element)) {
     genCustomDirectiveParser(customDir, body, useProperties, opCppClassName);
   } else if (isa<OperandsDirective>(element)) {
-    body << "  ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();\n"
+    body << "  [[maybe_unused]] ::llvm::SMLoc allOperandLoc ="
+         << " parser.getCurrentLocation();\n"
          << "  if (parser.parseOperandList(allOperands))\n"
          << "    return ::mlir::failure();\n";
 


        


More information about the Mlir-commits mailing list