From 7eb1f1856c3b6549544256da9c4b881f695903cc Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 11 Dec 2014 20:12:55 +0000 Subject: Remove a convoluted way of calling close by moving the call to the only caller. As a bonus we can actually check the return value. llvm-svn: 224046 --- llvm/lib/Support/MemoryBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/MemoryBuffer.cpp') diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index 539b6c3e754..385ed6a5842 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -204,7 +204,7 @@ class MemoryBufferMMapFile : public MemoryBuffer { public: MemoryBufferMMapFile(bool RequiresNullTerminator, int FD, uint64_t Len, uint64_t Offset, std::error_code EC) - : MFR(FD, false, sys::fs::mapped_file_region::readonly, + : MFR(FD, sys::fs::mapped_file_region::readonly, getLegalMapSize(Len, Offset), getLegalMapOffset(Offset), EC) { if (!EC) { const char *Start = getStart(Len, Offset); -- cgit v1.2.3