diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 14:11:15 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 14:11:15 +0000 |
commit | 2e0372d69ab11fb6c38b35d533e0a6358fd38658 (patch) | |
tree | c8888f406e8c1ac4018499f1b5763fa25f35fbc7 | |
parent | ddee9b46917d10e7d854011d275b77ad41693726 (diff) | |
download | external_llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.zip external_llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.tar.gz external_llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.tar.bz2 |
Remove the old file memory mapping functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183828 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/PathV1.h | 23 | ||||
-rw-r--r-- | lib/Support/MemoryBuffer.cpp | 3 | ||||
-rw-r--r-- | lib/Support/Unix/Path.inc | 17 | ||||
-rw-r--r-- | lib/Support/Windows/Path.inc | 11 |
4 files changed, 1 insertions, 53 deletions
diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h index bc15cd3..232167a 100644 --- a/include/llvm/Support/PathV1.h +++ b/include/llvm/Support/PathV1.h @@ -495,29 +495,6 @@ namespace sys { bool eraseFromDisk(bool destroy_contents = false, std::string *Err = 0) const; - - /// MapInFilePages - This is a low level system API to map in the file - /// that is currently opened as FD into the current processes' address - /// space for read only access. This function may return null on failure - /// or if the system cannot provide the following constraints: - /// 1) The pages must be valid after the FD is closed, until - /// UnMapFilePages is called. - /// 2) Any padding after the end of the file must be zero filled, if - /// present. - /// 3) The pages must be contiguous. - /// - /// This API is not intended for general use, clients should use - /// MemoryBuffer::getFile instead. - static const char *MapInFilePages(int FD, size_t FileSize, - off_t Offset); - - /// UnMapFilePages - Free pages mapped into the current process by - /// MapInFilePages. - /// - /// This API is not intended for general use, clients should use - /// MemoryBuffer::getFile instead. - static void UnMapFilePages(const char *Base, size_t FileSize); - /// @} /// @name Data /// @{ diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 7c5ab96..82812c0 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -33,8 +33,7 @@ #include <unistd.h> #else #include <io.h> -// Simplistic definitinos of these macros to allow files to be read with -// MapInFilePages. +// Simplistic definitinos of these macros for use in getOpenFile. #ifndef S_ISREG #define S_ISREG(x) (1) #endif diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 39538d0..7b236a5 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -773,21 +773,4 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) { #endif return false; } - -const char *Path::MapInFilePages(int FD, size_t FileSize, off_t Offset) { - int Flags = MAP_PRIVATE; -#ifdef MAP_FILE - Flags |= MAP_FILE; -#endif - void *BasePtr = ::mmap(0, FileSize, PROT_READ, Flags, FD, Offset); - if (BasePtr == MAP_FAILED) - return 0; - return (const char*)BasePtr; -} - -void Path::UnMapFilePages(const char *BasePtr, size_t FileSize) { - const void *Addr = static_cast<const void *>(BasePtr); - ::munmap(const_cast<void *>(Addr), FileSize); -} - } // end llvm namespace diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index b5a703a..f4a2a1b 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -788,16 +788,5 @@ Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) { CloseHandle(h); return false; } - -/// MapInFilePages - Not yet implemented on win32. -const char *Path::MapInFilePages(int FD, size_t FileSize, off_t Offset) { - return 0; -} - -/// MapInFilePages - Not yet implemented on win32. -void Path::UnMapFilePages(const char *Base, size_t FileSize) { - assert(0 && "NOT IMPLEMENTED"); -} - } } |