aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 03:54:16 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 03:54:16 +0000
commit800979259eaf99023bedafe281e3deca2f3a3310 (patch)
treed5fd3e34f5c4a3028613443f11f19cb6ba48d0cc /clang/lib/Basic/SourceManager.cpp
parent1ed28ce3fd9cbefcdfc3f9c2001c14e7997f1d64 (diff)
downloadllvm-800979259eaf99023bedafe281e3deca2f3a3310.zip
llvm-800979259eaf99023bedafe281e3deca2f3a3310.tar.gz
llvm-800979259eaf99023bedafe281e3deca2f3a3310.tar.bz2
make "ContentCache::Buffer" mutable to avoid a const_cast.
llvm-svn: 62403
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index fa0a9bb..1240262 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -56,9 +56,7 @@ const llvm::MemoryBuffer* ContentCache::getBuffer() const {
if (!Buffer && Entry) {
// FIXME: Should we support a way to not have to do this check over
// and over if we cannot open the file?
- // FIXME: This const_cast is ugly. Should we make getBuffer() non-const?
- const_cast<ContentCache*>(this)->Buffer =
- MemoryBuffer::getFile(Entry->getName(), 0, Entry->getSize());
+ Buffer = MemoryBuffer::getFile(Entry->getName(), 0, Entry->getSize());
}
#endif
return Buffer;