diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 03:54:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 03:54:16 +0000 |
commit | 800979259eaf99023bedafe281e3deca2f3a3310 (patch) | |
tree | d5fd3e34f5c4a3028613443f11f19cb6ba48d0cc /clang/lib/Basic/SourceManager.cpp | |
parent | 1ed28ce3fd9cbefcdfc3f9c2001c14e7997f1d64 (diff) | |
download | llvm-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.cpp | 4 |
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; |