Allow to store precompiled preambles in memory.
authorIlya Biryukov <ibiryukov@google.com>
Thu, 16 Nov 2017 16:25:01 +0000 (16:25 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Thu, 16 Nov 2017 16:25:01 +0000 (16:25 +0000)
commit417085ac37e34f9504aaf86769cd2e2407b3780f
tree685124cd666f132c856e08f4757488f9d61723ba
parent8562eb32c9a5a44ee1bda92cba825f014d8a5e5a
Allow to store precompiled preambles in memory.

Summary:
These preambles are built by ASTUnit and clangd. Previously, preambles
were always stored on disk.

In-memory preambles are routed back to the compiler as virtual files in
a custom VFS.

Interface of ASTUnit does not allow to use in-memory preambles, as
ASTUnit::CodeComplete receives FileManager as a parameter, so we can't
change VFS used by the compiler inside the CodeComplete method.

A follow-up commit will update clangd in clang-tools-extra to use
in-memory preambles.

Reviewers: klimek, sammccall, bkramer

Reviewed By: klimek

Subscribers: ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D39842

llvm-svn: 318411
clang/include/clang/Frontend/FrontendActions.h
clang/include/clang/Frontend/PrecompiledPreamble.h
clang/lib/Frontend/ASTUnit.cpp
clang/lib/Frontend/FrontendActions.cpp
clang/lib/Frontend/PrecompiledPreamble.cpp