aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/System
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 /include/llvm/System
parenta7750c1142baa5ad812d5209526a0b6568201e0e (diff)
downloadexternal_llvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.zip
external_llvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.tar.gz
external_llvm-37db5d67f92504226c17cfbf98c07c7bbe3afc3b.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 'include/llvm/System')
-rw-r--r--include/llvm/System/MappedFile.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/include/llvm/System/MappedFile.h b/include/llvm/System/MappedFile.h
index 82ed840..c46491e 100644
--- a/include/llvm/System/MappedFile.h
+++ b/include/llvm/System/MappedFile.h
@@ -25,7 +25,7 @@ namespace sys {
/// This class provides an abstraction for a memory mapped file in the
/// operating system's filesystem. It provides platform independent operations
- /// for mapping a file into memory for both read access.
+ /// for mapping a file into memory for read access.
class MappedFile {
sys::PathWithStatus Path; ///< Path to the file.
void *BasePtr; ///< Pointer to the base memory address
@@ -44,19 +44,9 @@ namespace sys {
/// This function determines if the file is currently mapped or not.
bool isMapped() const { return BasePtr != 0; }
- /// This function returns a void* pointer to the base address of the file
+ /// getBase - Returns a const void* pointer to the base address of the file
/// mapping. This is the memory address of the first byte in the file.
- /// Note that although a non-const pointer is returned, the memory might
- /// not actually be writable, depending on the MappingOptions used when
- /// the MappedFile was opened.
- void* base() const { return BasePtr; }
-
- /// This function returns a char* pointer to the base address of the file
- /// mapping. This is the memory address of the first byte in the file.
- /// Note that although a non-const pointer is returned, the memory might
- /// not actually be writable, depending on the MappingOptions used when
- /// the MappedFile was opened.
- char* charBase() const { return reinterpret_cast<char*>(BasePtr); }
+ const void *getBase() const { return BasePtr; }
/// This function returns a reference to the sys::Path object kept by the
/// MappedFile object. This contains the path to the file that is or