Skip to content

Commit

Permalink
[MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789)
Browse files Browse the repository at this point in the history
  • Loading branch information
hokein authored Nov 4, 2024
1 parent 310bb3b commit 790cbee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mlir/tools/mlir-tblgen/OpFormatGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 790cbee

Please sign in to comment.