Skip to content

Commit 790cbee

Browse files
authored
[MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789)
1 parent 310bb3b commit 790cbee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mlir/tools/mlir-tblgen/OpFormatGen.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,9 @@ class OIListElement : public DirectiveElementBase<DirectiveElement::OIList> {
229229

230230
/// Returns a range to iterate over the LiteralElements.
231231
auto getLiteralElements() const {
232-
function_ref<LiteralElement *(FormatElement * el)>
233-
literalElementCastConverter =
234-
[](FormatElement *el) { return cast<LiteralElement>(el); };
235-
return llvm::map_range(literalElements, literalElementCastConverter);
232+
return llvm::map_range(literalElements, [](FormatElement *el) {
233+
return cast<LiteralElement>(el);
234+
});
236235
}
237236

238237
/// Returns a range to iterate over the parsing elements corresponding to the

0 commit comments

Comments
 (0)