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 /lib/Support | |
parent | ddee9b46917d10e7d854011d275b77ad41693726 (diff) | |
download | llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.tar.gz llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.tar.bz2 llvm-2e0372d69ab11fb6c38b35d533e0a6358fd38658.tar.xz |
Remove the old file memory mapping functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-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 |
3 files changed, 1 insertions, 30 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 7c5ab96a76..82812c0aed 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 39538d0e06..7b236a56e1 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 b5a703a151..f4a2a1b447 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"); -} - } } |