]> granicus.if.org Git - clang/commit
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)
commitc77e69d5007744bc5bcdf4df3e4c3faadf6cce83
tree86e07297f8e9bf165060657975666fe2e64bb999
parent54d7831c3b8f99ed297abd939f1cd6a884c03a99
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
12 files changed:
include/clang/Basic/SourceManager.h
include/clang/Frontend/ASTUnit.h
include/clang/Lex/PreprocessorOptions.h
lib/Basic/SourceManager.cpp
lib/CodeGen/CodeGenAction.cpp
lib/Frontend/CompilerInstance.cpp
lib/Index/SimpleFormatContext.h
tools/clang-format/ClangFormat.cpp
tools/libclang/CIndex.cpp
tools/libclang/CIndexCodeCompletion.cpp
tools/libclang/Indexing.cpp
unittests/Tooling/RewriterTestContext.h