From 2e0372d69ab11fb6c38b35d533e0a6358fd38658 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Jun 2013 14:11:15 +0000 Subject: Remove the old file memory mapping functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183828 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/MemoryBuffer.cpp | 3 +-- lib/Support/Unix/Path.inc | 17 ----------------- lib/Support/Windows/Path.inc | 11 ----------- 3 files changed, 1 insertion(+), 30 deletions(-) (limited to 'lib/Support') 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 #else #include -// 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(BasePtr); - ::munmap(const_cast(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"); -} - } } -- cgit v1.2.3