This has been a TODO for a long time, and it brings about many advantages (namely nice accessors, and less fragile code). The existing overloads that accept ArrayRef are now treated as deprecated and will be removed in a followup (after a small grace period). Most of the upstream MLIR usages have been fixed by this commit, the rest will be handled in a followup.
Very nice usability improvement!
Nit: I know this is a large-scale refactoring, but could we fix this particular place in the documentation to be adaptor.source() instead of using getOperands + magic number? For the sake of documenting best practices.
Is it too early to put LLVM_ATTRIBUTE_DEPRECATED here?
heads up: I added an emitCInterface parameter to some of these calls at exactly the same line, so you probably need to resolve some conflicts on the rebase with main