aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-13 02:58:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-13 02:58:51 +0000
commit56c3ed854f0a5765ec6777b2beac99893c7e1ccc (patch)
tree1adb160889b3ced184952ea08a95084e1b3e25b1
parent3343be3f2efc0a4907cf5ed99d2218a10ef46345 (diff)
Make the size() method const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18852 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/System/MappedFile.h4
-rw-r--r--lib/System/Unix/MappedFile.cpp2
-rw-r--r--lib/System/Unix/MappedFile.inc2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/System/MappedFile.h b/include/llvm/System/MappedFile.h
index 526d11b4da..f73618aeb4 100644
--- a/include/llvm/System/MappedFile.h
+++ b/include/llvm/System/MappedFile.h
@@ -94,7 +94,7 @@ namespace sys {
/// This function returns the number of bytes in the file.
/// @throws std::string if an error occurs
- size_t size();
+ size_t size() const;
/// @}
/// @name Mutators
@@ -137,7 +137,7 @@ namespace sys {
sys::Path path_; ///< Path to the file.
int options_; ///< Options used to create the mapping
void* base_; ///< Pointer to the base memory address
- MappedFileInfo* info_; ///< Platform specific info for the mapping
+ mutable MappedFileInfo* info_; ///< Platform specific info for the mapping
/// @}
/// @name Disabled
diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp
index 1c9622d362..36a17e0f2c 100644
--- a/lib/System/Unix/MappedFile.cpp
+++ b/lib/System/Unix/MappedFile.cpp
@@ -108,7 +108,7 @@ void* MappedFile::map() {
return base_;
}
-size_t MappedFile::size() {
+size_t MappedFile::size() const {
assert(info_ && "MappedFile not initialized");
return info_->sbuf_.st_size;
}
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index 1c9622d362..36a17e0f2c 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -108,7 +108,7 @@ void* MappedFile::map() {
return base_;
}
-size_t MappedFile::size() {
+size_t MappedFile::size() const {
assert(info_ && "MappedFile not initialized");
return info_->sbuf_.st_size;
}