mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user