OpBuilder provides helper functions for cloning ops. MLIR also provides helper functions for cloning regions, but they are currently part of RewriterBase. They can be part of OpBuilder because they only insert new IR.
To be compatible with the dialect conversion, blocks (and their containing ops) must be notified according to their successor relationship. Without dialect conversion in mind, this may seem arbitrary, but it is a valid notification order for any listener. For a general listener, the only requirement when cloning IR is that we send out notifications in way that could that have been the result of creating the operations (and blocks) one-by-one through the builder API.
Dialect conversion is simplified: cloneRegionBefore is no longer overridden. Furthermore, regions that are inserted via OpBuilder::clone are now notified in an order that is suitable for dialect conversion. (Dialect conversion used to override RewriterBase::cloneRegionBefore but not OpBuilder::clone; this was a bug.)
Depends On: D144266
This class is free of a vtable right now and as a default destructor. We're making it not just free anymore to just use freely an OpBuilder anywhere just as a convenient access to the method it provides to get builtin attributes/types.