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
This commit is contained in:
Chris Lattner
2008-04-01 03:40:53 +00:00
parent a7750c1142
commit 37db5d67f9
3 changed files with 11 additions and 20 deletions
+4 -3
View File
@@ -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<const char*>(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();