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
Showing
- include/clang/Basic/SourceManager.h 18 additions, 22 deletionsinclude/clang/Basic/SourceManager.h
- include/clang/Frontend/ASTUnit.h 1 addition, 1 deletioninclude/clang/Frontend/ASTUnit.h
- include/clang/Lex/PreprocessorOptions.h 9 additions, 9 deletionsinclude/clang/Lex/PreprocessorOptions.h
- lib/Basic/SourceManager.cpp 21 additions, 26 deletionslib/Basic/SourceManager.cpp
- lib/CodeGen/CodeGenAction.cpp 2 additions, 4 deletionslib/CodeGen/CodeGenAction.cpp
- lib/Frontend/CompilerInstance.cpp 1 addition, 1 deletionlib/Frontend/CompilerInstance.cpp
- lib/Index/SimpleFormatContext.h 1 addition, 2 deletionslib/Index/SimpleFormatContext.h
- tools/clang-format/ClangFormat.cpp 1 addition, 1 deletiontools/clang-format/ClangFormat.cpp
- tools/libclang/CIndex.cpp 4 additions, 4 deletionstools/libclang/CIndex.cpp
- tools/libclang/CIndexCodeCompletion.cpp 2 additions, 2 deletionstools/libclang/CIndexCodeCompletion.cpp
- tools/libclang/Indexing.cpp 2 additions, 2 deletionstools/libclang/Indexing.cpp
- unittests/Tooling/RewriterTestContext.h 1 addition, 2 deletionsunittests/Tooling/RewriterTestContext.h
Loading
Please register or sign in to comment