[mlir][ods] (NFC) don't use std::function for map_range

This commit is contained in:
Mogball 2022-05-12 05:14:25 +00:00
parent 19906262c9
commit 0ffef0c23b
1 changed files with 1 additions and 4 deletions

View File

@ -187,10 +187,7 @@ public:
/// Returns a range to iterate over the LiteralElements.
auto getLiteralElements() const {
// The use of std::function is unfortunate but necessary here. Lambda
// functions cannot be copied but std::function can be copied. This copy
// constructor is used in llvm::zip.
std::function<LiteralElement *(FormatElement * el)>
function_ref<LiteralElement *(FormatElement * el)>
literalElementCastConverter =
[](FormatElement *el) { return cast<LiteralElement>(el); };
return llvm::map_range(literalElements, literalElementCastConverter);