This change introduces two new methods: finalizeSegment and appendIndex; and removes three old methods: endDim, appendCurrentPointer, appendIndex. The two new methods better encapsulate their algorithms, thus allowing to remove repetitious code in several other places.
Depends On D122435
ah, an overflow check, please add that as string at end to make semantics more clear
(and other parts of MLIR will break long before this as I found out earlier ;-)