|
10 | 10 | #include "mlir/TableGen/GenInfo.h" |
11 | 11 | #include "llvm/ADT/MapVector.h" |
12 | 12 | #include "llvm/ADT/STLExtras.h" |
| 13 | +#include "llvm/ADT/SmallVectorExtras.h" |
13 | 14 | #include "llvm/Support/CommandLine.h" |
14 | 15 | #include "llvm/Support/FormatVariadic.h" |
15 | 16 | #include "llvm/TableGen/Error.h" |
@@ -161,13 +162,12 @@ void printParseConditional(mlir::raw_indented_ostream &ios, |
161 | 162 | return formatv("read{0}", capitalize(name)); |
162 | 163 | }; |
163 | 164 |
|
164 | | - auto parsedArgs = |
165 | | - llvm::to_vector(make_filter_range(args, [](const Init *const attr) { |
166 | | - const Record *def = cast<DefInit>(attr)->getDef(); |
167 | | - if (def->isSubClassOf("Array")) |
168 | | - return true; |
169 | | - return !def->getValueAsString("cParser").empty(); |
170 | | - })); |
| 165 | + auto parsedArgs = llvm::filter_to_vector(args, [](const Init *const attr) { |
| 166 | + const Record *def = cast<DefInit>(attr)->getDef(); |
| 167 | + if (def->isSubClassOf("Array")) |
| 168 | + return true; |
| 169 | + return !def->getValueAsString("cParser").empty(); |
| 170 | + }); |
171 | 171 |
|
172 | 172 | interleave( |
173 | 173 | zip(parsedArgs, argNames), |
@@ -277,8 +277,8 @@ void Generator::emitParseHelper(StringRef kind, StringRef returnType, |
277 | 277 | printParseConditional(ios, args, argNames); |
278 | 278 |
|
279 | 279 | // Compute args to pass to create method. |
280 | | - auto passedArgs = llvm::to_vector(make_filter_range( |
281 | | - argNames, [](StringRef str) { return !str.starts_with("_"); })); |
| 280 | + auto passedArgs = llvm::filter_to_vector( |
| 281 | + argNames, [](StringRef str) { return !str.starts_with("_"); }); |
282 | 282 | std::string argStr; |
283 | 283 | raw_string_ostream argStream(argStr); |
284 | 284 | interleaveComma(passedArgs, argStream, |
|
0 commit comments