From b3a0758832f24d1d264dfe29f2a4fb46a500beb6 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 7 Oct 2014 19:09:05 +0000 Subject: [PATCH] Remove the IsVolatileSize parameter of getOpenFileSlice. getOpenFileSlice gets passed the map size, so it makes no sense to say that the size is volatile. The code will not even compute the size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219226 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/MemoryBuffer.h | 6 +----- lib/Support/MemoryBuffer.cpp | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index a8dc9d7613e..341850a538d 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -78,13 +78,9 @@ public: /// Given an already-open file descriptor, map some slice of it into a /// MemoryBuffer. The slice is specified by an \p Offset and \p MapSize. /// Since this is in the middle of a file, the buffer is not null terminated. - /// - /// \param IsVolatileSize Set to true to indicate that the file size may be - /// changing, e.g. when libclang tries to parse while the user is - /// editing/updating the file. static ErrorOr> getOpenFileSlice(int FD, const Twine &Filename, uint64_t MapSize, - int64_t Offset, bool IsVolatileSize = false); + int64_t Offset); /// Given an already-open file descriptor, read the file and return a /// MemoryBuffer. diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 9ccbcbf587d..a9ccf98f1b3 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -406,9 +406,10 @@ MemoryBuffer::getOpenFile(int FD, const Twine &Filename, uint64_t FileSize, ErrorOr> MemoryBuffer::getOpenFileSlice(int FD, const Twine &Filename, uint64_t MapSize, - int64_t Offset, bool IsVolatileSize) { + int64_t Offset) { + assert(MapSize != uint64_t(-1)); return getOpenFileImpl(FD, Filename, -1, MapSize, Offset, false, - IsVolatileSize); + /*IsVolatileSize*/ false); } ErrorOr> MemoryBuffer::getSTDIN() { -- 2.11.0