- Arguments of the first block of a region are considered region arguments.
- Add API on Region class to deal with these arguments directly instead of using the front() block.
- Changed several instances of existing code that can use this API
- Fixes https://bugs.llvm.org/show_bug.cgi?id=46535
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'd like to hear from @stephenneuendorffer about how this fits with D80358 ; we may want to assert on the type of Region, or use some sort of interface I'm not sure.
Looking at https://reviews.llvm.org/D80358, I don't see the definition of region arguments being entry block arguments changing.
And build failure are clang_tidy warnings for args_begin() etc functions. @mehdi_amini , how are these warnings currently suppressed in say Block.h? Or do we just ignore them? Also, based on the fact that definition of region entry block and its arguments being region arguments is not changing, can you unblock the change?
Yes, I agree. I think it makes sense for Regions to have the same arguments as their blocks. However, the relationship between operation arguments and region arguments is something that is determined by the semantics of each individual operation. With FuncOp, the function arguments and region arguments have the same type and arity, but in general, they may not.
clang-tidy: warning: invalid case style for function 'args_begin' [readability-identifier-naming]
not useful