diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-06-27 17:40:03 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-06-27 17:40:03 +0000 |
commit | c77e69d5007744bc5bcdf4df3e4c3faadf6cce83 (patch) | |
tree | 86e07297f8e9bf165060657975666fe2e64bb999 /unittests | |
parent | 54d7831c3b8f99ed297abd939f1cd6a884c03a99 (diff) | |
download | clang-c77e69d5007744bc5bcdf4df3e4c3faadf6cce83.tar.gz clang-c77e69d5007744bc5bcdf4df3e4c3faadf6cce83.tar.bz2 clang-c77e69d5007744bc5bcdf4df3e4c3faadf6cce83.tar.xz |
Remove 'const' from MemoryBuffers used through the SourceManager
This removes a const_cast added in r211884 that occurred due to an
inconsistency in how MemoryBuffers are handled between some parts of
clang and LLVM.
MemoryBuffers are immutable and the general convention in the LLVM
project is to omit const from immutable types as it's simply
redundant/verbose (see llvm::Type, for example). While this change
doesn't remove "const" from /every/ MemoryBuffer, it at least makes this
chain of ownership/usage consistent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Tooling/RewriterTestContext.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/unittests/Tooling/RewriterTestContext.h b/unittests/Tooling/RewriterTestContext.h index ed29f8c04d..fe108ad308 100644 --- a/unittests/Tooling/RewriterTestContext.h +++ b/unittests/Tooling/RewriterTestContext.h @@ -48,8 +48,7 @@ class RewriterTestContext { ~RewriterTestContext() {} FileID createInMemoryFile(StringRef Name, StringRef Content) { - const llvm::MemoryBuffer *Source = - llvm::MemoryBuffer::getMemBuffer(Content); + llvm::MemoryBuffer *Source = llvm::MemoryBuffer::getMemBuffer(Content); const FileEntry *Entry = Files.getVirtualFile(Name, Source->getBufferSize(), 0); Sources.overrideFileContents(Entry, Source); |