Remove the old file memory mapping functions.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 14:11:15 +0000 (14:11 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 14:11:15 +0000 (14:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183828 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/MemoryBuffer.cpp
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc

index bc15cd3beb8dff99943ce30b8b4aebad1a5bac53..232167a6ca552a254397b1ff14695bc40979bc70 100644 (file)
@@ -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
     /// @{
index 7c5ab96a764a33c9780a4dbe658b522ec2a7f4e3..82812c0aed61dc3c9fd7840bf57771d559959343 100644 (file)
@@ -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
index 39538d0e0616a350efc31da68e2e0c7b9566207f..7b236a56e11829469b819b06d0fbe199cc45a477 100644 (file)
@@ -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
index b5a703a1519933d56a5f1545cf5c32908350bc56..f4a2a1b447111450bc754aaebfb027434328bfd1 100644 (file)
@@ -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");
-}
-
 }
 }