[clangd][NFC] Remove unnecessary copy in CodeComplete

All tests still pass with ASAN so fairly confident no use-after-free going on here.
This commit is contained in:
Nathan James 2021-01-09 02:32:23 +00:00
parent 7d78875f93
commit 467cbd2981
No known key found for this signature in database
GPG Key ID: CC007AFCDA90AA5F
1 changed files with 2 additions and 2 deletions

View File

@ -1111,8 +1111,8 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
offsetToClangLineColumn(Input.ParseInput.Contents, Input.Offset);
std::unique_ptr<llvm::MemoryBuffer> 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