Issue #55173
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/OpImplementation.h | ||
---|---|---|
934 | I'd recommend passing the lambda inline instead of naming it. I also learned a trick where "emplace_back" will add a new empty entry to a vector and return a reference to it. This should allow you to turn this into: return parseCommaSeparatedList([&]() { return parseType(result.emplace_back()); }); | |
mlir/lib/Dialect/Affine/IR/AffineOps.cpp | ||
3485–3487 | These parser hooks support chaining with ||, plz give this a try: if (parser.parseCommaSeparatedList(parseOperands)) || parser.parseRParen()) return failure(); | |
mlir/lib/Dialect/DLTI/DLTI.cpp | ||
291 | Please use the same things above - you can move this inline, and use the emplace_back inline. |
Nice, thank you! A couple more suggestions above.
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | ||
---|---|---|
555–556 | You can simplify this one to "return parser.parseOperand(...);" | |
3074 | I /think/ you can use "return parser.emitError(...)" because the result converts to failure already. | |
3080 | here and below too (if I'm right) |
LG, much nicer! Thanks for tackling this.
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | ||
---|---|---|
2881–2885 | Can you move the lambda out of line here? It's kind of difficult to read here. | |
3067–3069 | Same here. | |
mlir/lib/Dialect/PDL/IR/PDL.cpp | ||
159–161 | Same here. | |
mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp | ||
82–84 | Same here. |
I'd recommend passing the lambda inline instead of naming it. I also learned a trick where "emplace_back" will add a new empty entry to a vector and return a reference to it. This should allow you to turn this into: