Remove 'const' from MemoryBuffers used through the SourceManager
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Jun 2014 17:40:03 +0000 (17:40 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Jun 2014 17:40:03 +0000 (17:40 +0000)
commit66cc07b4f72ca630846395dbbc60ebee7a5e0104
treeb02668e8a7183333470bc5e34ff591e347e54f5c
parent6c75b3a3c0a8350dd15181e9824d6d76e689ec3a
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.

llvm-svn: 211915
12 files changed:
clang/include/clang/Basic/SourceManager.h
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Lex/PreprocessorOptions.h
clang/lib/Basic/SourceManager.cpp
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Index/SimpleFormatContext.h
clang/tools/clang-format/ClangFormat.cpp
clang/tools/libclang/CIndex.cpp
clang/tools/libclang/CIndexCodeCompletion.cpp
clang/tools/libclang/Indexing.cpp
clang/unittests/Tooling/RewriterTestContext.h