diff options
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r-- | lib/Support/MemoryBuffer.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 8b009b84a5..2501f2ea98 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -251,11 +251,6 @@ static bool shouldUseMmap(int FD, if (!RequiresNullTerminator) return true; - -// LLVM uses mmap to read the file contents. This disallows use of the -// wrapper syscalls defined in tools/llc/nacl_file.c. Thus, when NACL_SRPC -// is specified, code sequence execising the read syscall below is used. -#if !defined(NACL_SRPC) // If we don't know the file size, use fstat to find out. fstat on an open // file descriptor is cheaper than stat on a random path. // FIXME: this chunk of code is duplicated, but it avoids a fstat when @@ -268,9 +263,6 @@ static bool shouldUseMmap(int FD, } FileSize = FileInfo.st_size; } -#else - assert(FileSize != -1 && "invalid file size!"); -#endif // If we need a null terminator and the end of the map is inside the file, // we cannot use mmap. @@ -298,7 +290,6 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename, if (MapSize == uint64_t(-1)) { // If we don't know the file size, use fstat to find out. fstat on an open // file descriptor is cheaper than stat on a random path. -#if !defined(NACL_SRPC) if (FileSize == uint64_t(-1)) { struct stat FileInfo; // TODO: This should use fstat64 when available. @@ -307,9 +298,6 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename, } FileSize = FileInfo.st_size; } -#else - assert(FileSize != -1 && "invalid file size!"); -#endif MapSize = FileSize; } |