[flang] [llvm] [flang] implement `split` for fortran 2023 (PR #161484)

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 08:36:32 PDT 2025


klausler wrote:

> > In Flang/docs/F202X.md there is a means of implementing `SPLIT` in terms of `SCAN`. Perhaps you could make `SPLIT` faster than `SCAN`, but if not, a second implementation of the same algorithm is redundant; they should be combined, or `SPLIT` should be a wrapper around `SCAN`.
> 
> I tried to create a generalized `CharacterSearch` function for scan/split/verify purposes. However, I realized that it becomes messy when dealing with pre/post conditions such as `pos` and return values. Specifically, the algorithms for scan/split are subtly different from verify. Additionally, scan/split have different starting points and edge case return values. Considering that scan/verify are handled together, perhaps it would be clearer to have a separate implementation for split at certain points?

My point was that `SPLIT` can be defined as a `SCAN` with some adjustments to the arguments and results.

https://github.com/llvm/llvm-project/pull/161484


More information about the llvm-commits mailing list