summaryrefslogtreecommitdiffstats
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
commit35f16dd40bfa0c23748cec78bc04323dc78fd6d3 (patch)
treeaaf100a650144cbf435210cb42d59686f14f3d97
parent15681d988e1301995990cd8beadba4382f840bf3 (diff)
downloadbcm5719-llvm-35f16dd40bfa0c23748cec78bc04323dc78fd6d3.tar.gz
bcm5719-llvm-35f16dd40bfa0c23748cec78bc04323dc78fd6d3.zip
Make the size() method const
llvm-svn: 18852
-rw-r--r--llvm/include/llvm/System/MappedFile.h4
-rw-r--r--llvm/lib/System/Unix/MappedFile.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/System/MappedFile.h b/llvm/include/llvm/System/MappedFile.h
index 526d11b4dac..f73618aeb40 100644
--- a/llvm/include/llvm/System/MappedFile.h
+++ b/llvm/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/llvm/lib/System/Unix/MappedFile.cpp b/llvm/lib/System/Unix/MappedFile.cpp
index 1c9622d3623..36a17e0f2c4 100644
--- a/llvm/lib/System/Unix/MappedFile.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud