[Mlir-commits] [mlir] 441b683 - [mlir] Fix a warning

Kazu Hirata llvmlistbot at llvm.org
Thu May 1 12:35:01 PDT 2025


Author: Kazu Hirata
Date: 2025-05-01T12:34:55-07:00
New Revision: 441b68370a2fb97c1a650de15528e5600eacab6b

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

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp:586:14: error:
  variable 'realParam' set but not used
  [-Werror,-Wunused-but-set-variable]

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
index 5c5303e27fde3..10a162f81ba13 100644
--- a/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
@@ -583,7 +583,7 @@ void DefFormat::genStructParser(StructDirective *el, FmtContext &ctx,
   for (FormatElement *arg : el->getElements()) {
     ParameterElement *param = getEncapsulatedParameterElement(arg);
     os.getStream().printReindented(strfmt(checkParamKey, param->getName()));
-    if (auto realParam = dyn_cast<ParameterElement>(arg))
+    if (isa<ParameterElement>(arg))
       genVariableParser(param, ctx, os.indent());
     else if (auto custom = dyn_cast<CustomDirective>(arg))
       genCustomParser(custom, ctx, os.indent());


        


More information about the Mlir-commits mailing list