summaryrefslogtreecommitdiff
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-01 03:40:53 +0000
committerChris Lattner <sabre@nondot.org>2008-04-01 03:40:53 +0000
commit37db5d67f92504226c17cfbf98c07c7bbe3afc3b (patch)
tree28d1260d19e98f93952115670ce81bbd61bf3390 /lib/Support/MemoryBuffer.cpp
parenta7750c1142baa5ad812d5209526a0b6568201e0e (diff)
downloadllvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.tar.gz
llvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.tar.bz2
llvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.tar.xz
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/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp7
1 files changed, 4 insertions, 3 deletions
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<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();