Details
- Reviewers
rriddle
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
mlir/include/mlir/IR/PatternMatch.h | ||
---|---|---|
923 | You should also forward the first arg. |
Yes, they are real. The arguments here are rvalues, so after the first pattern they are use-after-move.
I'm not sure if I want to proceed with this change. It might be safer to require using the add() overload on line 960 if pattern arguments are move-only. WDYT?
Yeah, I think that is a reasonable trade off. The other thing we could do is have an add<> overload for when there is only one pattern being added. We could keep the multi-pattern add the way it is now, but have the single-pattern one use perfect forwarding.
The other thing we could do is have an add<> overload for when there is only one pattern being added. We could keep the multi-pattern add the way it is now, but have the single-pattern one use perfect forwarding.
Yes, that would be possible. But it only saves the 'std::make_unique' characters. Probably not worth it.
You should also forward the first arg.