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 | 05816591ec488a933dfecc9ff9f3cbf3c32767c2 (patch) | |
tree | 0bac1e3ee0ef775b1be748072f80cbcde12cb404 /lib/Basic/SourceManager.cpp | |
parent | 5c263857e2c3e7dce30ad32bb93b4a428896adb4 (diff) |
make "ContentCache::Buffer" mutable to avoid a const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index fa0a9bb565..1240262007 100644 --- a/lib/Basic/SourceManager.cpp +++ b/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; |