diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2017-11-24 13:12:38 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2017-11-24 13:12:38 +0000 |
commit | 8318f61bb87b15e21572e7650ad7c0a6b7e327b8 (patch) | |
tree | 914fc5268be85f03827d6b4ad6078e89a6907ea8 /clang/lib/Frontend/PrecompiledPreamble.cpp | |
parent | 2660cc96dd683e4e252e4909af84a86d360994f4 (diff) | |
download | bcm5719-llvm-8318f61bb87b15e21572e7650ad7c0a6b7e327b8.tar.gz bcm5719-llvm-8318f61bb87b15e21572e7650ad7c0a6b7e327b8.zip |
Avoid copying the data of in-memory preambles
Summary: Preambles are large and we should avoid copying them.
Reviewers: bkramer, klimek
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40302
llvm-svn: 318945
Diffstat (limited to 'clang/lib/Frontend/PrecompiledPreamble.cpp')
-rw-r--r-- | clang/lib/Frontend/PrecompiledPreamble.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp index 130b9045c84..c6ee4d0289d 100644 --- a/clang/lib/Frontend/PrecompiledPreamble.cpp +++ b/clang/lib/Frontend/PrecompiledPreamble.cpp @@ -699,9 +699,7 @@ void PrecompiledPreamble::setupPreambleStorage( StringRef PCHPath = getInMemoryPreamblePath(); PreprocessorOpts.ImplicitPCHInclude = PCHPath; - // FIMXE(ibiryukov): Preambles can be large. We should allow shared access - // to the preamble data instead of copying it here. - auto Buf = llvm::MemoryBuffer::getMemBufferCopy(Storage.asMemory().Data); + auto Buf = llvm::MemoryBuffer::getMemBuffer(Storage.asMemory().Data); VFS = createVFSOverlayForPreamblePCH(PCHPath, std::move(Buf), VFS); } } |