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 | 66cc07b4f72ca630846395dbbc60ebee7a5e0104 (patch) | |
| tree | b02668e8a7183333470bc5e34ff591e347e54f5c /clang/tools/clang-format | |
| parent | 6c75b3a3c0a8350dd15181e9824d6d76e689ec3a (diff) | |
| download | bcm5719-llvm-66cc07b4f72ca630846395dbbc60ebee7a5e0104.tar.gz bcm5719-llvm-66cc07b4f72ca630846395dbbc60ebee7a5e0104.zip | |
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
Diffstat (limited to 'clang/tools/clang-format')
| -rw-r--r-- | clang/tools/clang-format/ClangFormat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp index e0239499af8..575ac7a93d8 100644 --- a/clang/tools/clang-format/ClangFormat.cpp +++ b/clang/tools/clang-format/ClangFormat.cpp @@ -103,7 +103,7 @@ static cl::list<std::string> FileNames(cl::Positional, cl::desc("[<file> ...]"), namespace clang { namespace format { -static FileID createInMemoryFile(StringRef FileName, const MemoryBuffer *Source, +static FileID createInMemoryFile(StringRef FileName, MemoryBuffer *Source, SourceManager &Sources, FileManager &Files) { const FileEntry *Entry = Files.getVirtualFile(FileName == "-" ? "<stdin>" : FileName, |

