forked from OSchip/llvm-project
[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:
parent
7d78875f93
commit
467cbd2981
|
@ -1111,8 +1111,8 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
|
||||||
offsetToClangLineColumn(Input.ParseInput.Contents, Input.Offset);
|
offsetToClangLineColumn(Input.ParseInput.Contents, Input.Offset);
|
||||||
|
|
||||||
std::unique_ptr<llvm::MemoryBuffer> ContentsBuffer =
|
std::unique_ptr<llvm::MemoryBuffer> ContentsBuffer =
|
||||||
llvm::MemoryBuffer::getMemBufferCopy(Input.ParseInput.Contents,
|
llvm::MemoryBuffer::getMemBuffer(Input.ParseInput.Contents,
|
||||||
Input.FileName);
|
Input.FileName);
|
||||||
// The diagnostic options must be set before creating a CompilerInstance.
|
// The diagnostic options must be set before creating a CompilerInstance.
|
||||||
CI->getDiagnosticOpts().IgnoreWarnings = true;
|
CI->getDiagnosticOpts().IgnoreWarnings = true;
|
||||||
// We reuse the preamble whether it's valid or not. This is a
|
// We reuse the preamble whether it's valid or not. This is a
|
||||||
|
|
Loading…
Reference in New Issue