Revisit API for get iterator sources in c/parallel test suite
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
#4645 adds `make_stateless_transform_iterator` and `make_stateful_transform_iterator` for transform iterators based on stateless and stateful transformation function respectively.
The API builds sources defining transformed iterator's state, and sources defining transformed iterator's advance/dereference functions from sources defining these things for the underlying iterator and sources for the transformation operation.
Such design necessitates access to definition source strings for the usual building blocks of common iterators, such as counting, constant, reversed iterators, etc.
An idea @shwina and I discussed is to reduce the API by storing definition strings in `iterator_t` struct itself. Doing so would allow `make_*_transformed_iterator` accept `iterator_t` instance describing the underlying iterator as well as an instance of `operation_t` that describes the transformation.
We can make it work at present at the expense of compiling definition sources for the underlying iterator, discarding them, and compiling definition sources for the transformed iterators.
If we had a way to declare function of underlying iterator `extern "C"`, and link to the LTOIR stored in `iterator_t` of the underlying iterator we might, perhaps, be faster than what we do now, which is generating longer program containing definitions for the underlying iterator, the transformation operation and the the transform iterator and compiling that to LTOIR.
This issue is to track that investigation and subsequent work should be deemed necessary.
Contributor guide
Assessment
This issue has not been assessed yet.