From 37db5d67f92504226c17cfbf98c07c7bbe3afc3b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 1 Apr 2008 03:40:53 +0000 Subject: Remove the MappedFile::charBase member, rename base -> getBase() and make getBase() return a const-correct pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49025 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/MemoryBuffer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Support/MemoryBuffer.cpp') diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 8cea07fdb5..185008402c 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -173,11 +173,12 @@ bool MemoryBufferMMapFile::open(const sys::Path &Filename, // If this file is not an exact multiple of the system page size (common // case), then the OS has zero terminated the buffer for us. - if ((Size & (PageSize-1))) { - init(File.charBase(), File.charBase()+Size); + const char *FileBase = static_cast(File.getBase()); + if ((Size & (PageSize-1)) != 0) { + init(FileBase, FileBase+Size); } else { // Otherwise, we allocate a new memory buffer and copy the data over - initCopyOf(File.charBase(), File.charBase()+Size); + initCopyOf(FileBase, FileBase+Size); // No need to keep the file mapped any longer. File.unmap(); -- cgit v1.2.3