Files
llvm/lib/Support
Pavel Labath 3ffae1923a [Support] Improve readNativeFile(Slice) interface
Summary:
There was a subtle, but pretty important difference between the Slice
and regular versions of this function. The Slice function was
zero-initializing the rest of the buffer when the read syscall returned
less bytes than expected, while the regular function did not.

This patch removes the inconsistency by making both functions *not*
zero-initialize the buffer. The zeroing code is moved to the
MemoryBuffer class, which is currently the only user of this code. This
makes the API more consistent, and the code shorter.

While in there, I also refactor the functions to return the number of
bytes through the regular return value (via Expected<size_t>) instead of
a separate by-ref argument.

Reviewers: aganea, rnk

Subscribers: kristina, Bigcheese, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369627 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 08:13:30 +00:00
..
2019-04-08 12:31:12 +00:00
2019-04-27 15:33:22 +00:00
2019-08-12 01:29:46 +00:00
2019-08-06 15:46:45 +00:00
2019-08-21 20:00:41 +00:00
2009-09-06 12:26:28 +00:00
2018-07-30 19:41:25 +00:00
2019-08-15 10:05:22 +00:00
2019-04-23 14:51:27 +00:00
2019-07-09 18:10:06 +00:00