summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2019-07-22 11:12:16 +0000
committerSam McCall <sam.mccall@gmail.com>2019-07-22 11:12:16 +0000
commit1df6be211e4c9cfbd842d3e37eaf7e90c3a40d40 (patch)
tree51654626f9874c4d9671f081ac344bf78795d9e7
parentaf5d3b02fbc6033b67629c8496d69c98ca960882 (diff)
downloadbcm5719-llvm-1df6be211e4c9cfbd842d3e37eaf7e90c3a40d40.tar.gz
bcm5719-llvm-1df6be211e4c9cfbd842d3e37eaf7e90c3a40d40.zip
[clangd] Set buffer name for main file. NFCI
llvm-svn: 366675
-rw-r--r--clang-tools-extra/clangd/ClangdUnit.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/ClangdUnit.cpp b/clang-tools-extra/clangd/ClangdUnit.cpp
index 3e9db706cfa..9908fee32b1 100644
--- a/clang-tools-extra/clangd/ClangdUnit.cpp
+++ b/clang-tools-extra/clangd/ClangdUnit.cpp
@@ -570,7 +570,8 @@ buildPreamble(PathRef FileName, CompilerInvocation &CI,
PreambleParsedCallback PreambleCallback) {
// Note that we don't need to copy the input contents, preamble can live
// without those.
- auto ContentsBuffer = llvm::MemoryBuffer::getMemBuffer(Inputs.Contents);
+ auto ContentsBuffer =
+ llvm::MemoryBuffer::getMemBuffer(Inputs.Contents, FileName);
auto Bounds =
ComputePreambleBounds(*CI.getLangOpts(), ContentsBuffer.get(), 0);
@@ -650,10 +651,10 @@ buildAST(PathRef FileName, std::unique_ptr<CompilerInvocation> Invocation,
// dirs.
}
- return ParsedAST::build(llvm::make_unique<CompilerInvocation>(*Invocation),
- Preamble,
- llvm::MemoryBuffer::getMemBufferCopy(Inputs.Contents),
- std::move(VFS), Inputs.Index, Inputs.Opts);
+ return ParsedAST::build(
+ llvm::make_unique<CompilerInvocation>(*Invocation), Preamble,
+ llvm::MemoryBuffer::getMemBufferCopy(Inputs.Contents, FileName),
+ std::move(VFS), Inputs.Index, Inputs.Opts);
}
SourceLocation getBeginningOfIdentifier(const ParsedAST &Unit,
OpenPOWER on IntegriCloud