diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-01 03:40:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-01 03:40:53 +0000 |
commit | 35aa79df510c0cf9ad37ec63377daaa351030772 (patch) | |
tree | 28d1260d19e98f93952115670ce81bbd61bf3390 /lib/Support | |
parent | cb80933bcf5bf6a9957317dbe7560a0a39a8be64 (diff) | |
download | external_llvm-35aa79df510c0cf9ad37ec63377daaa351030772.zip external_llvm-35aa79df510c0cf9ad37ec63377daaa351030772.tar.gz external_llvm-35aa79df510c0cf9ad37ec63377daaa351030772.tar.bz2 |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/MemoryBuffer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 8cea07f..1850084 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<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(); |