diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 1a8474f6c53d..53c647a68788 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -1111,8 +1111,8 @@ bool semaCodeComplete(std::unique_ptr Consumer, offsetToClangLineColumn(Input.ParseInput.Contents, Input.Offset); std::unique_ptr ContentsBuffer = - llvm::MemoryBuffer::getMemBufferCopy(Input.ParseInput.Contents, - Input.FileName); + llvm::MemoryBuffer::getMemBuffer(Input.ParseInput.Contents, + Input.FileName); // The diagnostic options must be set before creating a CompilerInstance. CI->getDiagnosticOpts().IgnoreWarnings = true; // We reuse the preamble whether it's valid or not. This is a