[llvm] [Support] mmap when possible in getSTDIN. (PR #162013)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 01:03:18 PDT 2025
aokblast wrote:
> I've given this a bit of thought and while there may be some use to the change you're trying to make for other tools, I actually think it's not the right solution for llvm-strings, since it doesn't fix the general case of reading from stdin. I actually think the correct thing to do would be to change llvm-strings to not try to read in the whole file up front, but rather read it in as required (presumably using some kind of stream implementation or similar). This will require changes to the core logic of the program, but it will reduce the memory usage for files as well as stdin.
Thanks for your reply! Yes, you are right. These are two seperate problems. So I am considering doing two things:
1. Fix the Windows problem in this patch since this patch is useful in other cases besides llvm-strings.
2. Change llvm-strings logic to use read directly instead of Memory Buffer. I think it is not really hard since llvm-strings is a 200 lines program.
https://github.com/llvm/llvm-project/pull/162013
More information about the llvm-commits
mailing list