[llvm] [llvm-strings] Use small buffer instead of reading whole file (PR #163073)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 00:52:44 PDT 2026


https://github.com/jh7370 commented:

How practical would a test case be that covers the case of a string straddling a chunk? You could assume the native read chunk size in the test, so that you can craft the input via a python script at runtime, but it would need to be reasonably fast. If it isn't we'd want to evaluate the benefits of the test (at the very least, you'd want to test manually even if you can't get a lit test to be fast enough for being in-tree). I'd have the following cases:
- At least min string size appears before boundary, unprintable byte as first byte of next chunk. Prefix is printed on its own.
- At least min string size appears before boundary, printable byte as first byte of next chunk. Prefix is printed with following characters.
- Less than min string size appears before boundary, unprintable byte as next byte. Prefix is not printed.
- Less than min string size appears before boundary, printable byte as next byte, forming a min length string. Prefix is printed with following characters.
- Prefix is empty at start of chunk that starts with a min length string.
- A string that spans the entirety of one chunk, with at least 1 character before the chunk start and 1 after the end of that chunk.



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


More information about the llvm-commits mailing list