aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-24 01:08:34 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-24 01:08:34 +0000
commit13ddaa8416c02b81fbab9357336f4e70624b7652 (patch)
tree7a0f6b255a547001b88203525cf7cd0e399acdf9 /contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
parentda09e106efc76da569f2bad3d59b6b19b503bf39 (diff)
parent6252156da5066bd47f63f8bd40404d1f89909d32 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp b/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
index c291a4b99d10..7d789e780113 100644
--- a/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
@@ -420,10 +420,9 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File,
CodeCompletionFile = File;
CodeCompletionOffset = Position - Buffer->getBufferStart();
- std::unique_ptr<MemoryBuffer> NewBuffer =
- MemoryBuffer::getNewUninitMemBuffer(Buffer->getBufferSize() + 1,
- Buffer->getBufferIdentifier());
- char *NewBuf = const_cast<char*>(NewBuffer->getBufferStart());
+ auto NewBuffer = llvm::WritableMemoryBuffer::getNewUninitMemBuffer(
+ Buffer->getBufferSize() + 1, Buffer->getBufferIdentifier());
+ char *NewBuf = NewBuffer->getBufferStart();
char *NewPos = std::copy(Buffer->getBufferStart(), Position, NewBuf);
*NewPos = '\0';
std::copy(Position, Buffer->getBufferEnd(), NewPos+1);