[Mlir-commits] [mlir] 790cbee - [MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 4 05:38:02 PST 2024


Author: Haojian Wu
Date: 2024-11-04T14:37:59+01:00
New Revision: 790cbee34dfd2a840e3ee363725bc5829331ff0f

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

LOG: [MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789)

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 3bf6f2f6d38176..7e2b0694a860a3 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -229,10 +229,9 @@ class OIListElement : public DirectiveElementBase<DirectiveElement::OIList> {
 
   /// Returns a range to iterate over the LiteralElements.
   auto getLiteralElements() const {
-    function_ref<LiteralElement *(FormatElement * el)>
-        literalElementCastConverter =
-            [](FormatElement *el) { return cast<LiteralElement>(el); };
-    return llvm::map_range(literalElements, literalElementCastConverter);
+    return llvm::map_range(literalElements, [](FormatElement *el) {
+      return cast<LiteralElement>(el);
+    });
   }
 
   /// Returns a range to iterate over the parsing elements corresponding to the


        


More information about the Mlir-commits mailing list