1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
llvm-mirror/lib/Support/Windows
Pavel Labath 757587cb21 [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

llvm-svn: 369627
2019-08-22 08:13:30 +00:00
..
COM.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DynamicLibrary.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
explicit_symbols.inc Remove support for unsupported MSVC versions 2019-08-02 23:09:01 +00:00
Host.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Memory.inc [Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and OwningMemoryBlock. 2019-05-20 20:53:05 +00:00
Path.inc [Support] Improve readNativeFile(Slice) interface 2019-08-22 08:13:30 +00:00
Process.inc [Support] Add error handling to sys::Process::getPageSize(). 2019-05-08 02:11:07 +00:00
Program.inc Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
Signals.inc Support for dumping current PrettyStackTrace on SIGINFO (Ctrl-T) 2019-07-12 16:05:09 +00:00
Threading.inc [llvm][Support] Provide interface to set thread priorities 2019-04-16 14:32:43 +00:00
ThreadLocal.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Watchdog.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WindowsSupport.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00