Extract the readNativeFile() loop from
MemoryBuffer::getMemoryBufferForStream() into readNativeFileToEOF()
to allow reuse. The chunk size is configurable; the default of 4*4096
is exposed as sys::fs::DefaultReadChunkSize to allow sizing of
SmallVectors.
There's somewhere I'd like to read a usually small file without overhead of a MemoryBuffer; extracting existing logic rather than duplicating it.
Test depends on https://reviews.llvm.org/D115395 (built on top of https://reviews.llvm.org/D115384, but they could be reordered...).