Many ops with this trait have getBody() and getBodyBuilder() methods defined in extraClassDeclaration in tablegen. getBody() implementation is the same accross all these ops, but getBodyBuilder() can return builders with varying insertion points set. In this PR, getBody() is moved into SingleImplicitBlockTerminator struct and getBodyBuilder() is replaced with OpBuilder::atBlock(End|Terminator)(op.getBody);.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Looks great, thanks for the cleanup! LGTM after resolving the comments about assert messages
mlir/include/mlir/IR/Builders.h | ||
---|---|---|
213 | nit: Please update all of the asserts to start with lowercase and end with no period. |
This seems weird. I would expect you to just do block->getTerminator()