[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D39842#927578, @mgorny wrote: > Please revert this commit. You've just broken all the stand-alone builds of > clang. Sorry about that. Should be fixed in https://reviews.llvm.org/rL318514 Repository: rL LLVM

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Please revert this commit. You've just broken all the stand-alone builds of clang. Comment at: cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp:27 #include "llvm/ADT/StringSet.h" +#include "llvm/Config/config.h" #include

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318411: Allow to store precompiled preambles in memory. (authored by ibiryukov). Repository: rL LLVM https://reviews.llvm.org/D39842 Files: cfe/trunk/include/clang/Frontend/FrontendActions.h

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 123172. ilya-biryukov added a comment. - Removed redundant #include. https://reviews.llvm.org/D39842 Files: include/clang/Frontend/FrontendActions.h include/clang/Frontend/PrecompiledPreamble.h lib/Frontend/ASTUnit.cpp

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 123171. ilya-biryukov added a comment. - Use a hard-coded virtual path for in-memory PCHs instead of system_temp_directory. https://reviews.llvm.org/D39842 Files: include/clang/Frontend/FrontendActions.h

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:44 +SmallString<64> Path; +llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/true, Path); +llvm::sys::path::append(Path, "___clang_inmemory_preamble___");

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-16 Thread Manuel Klimek via Phabricator via cfe-commits
klimek accepted this revision. klimek added a comment. This revision is now accepted and ready to land. LG Comment at: lib/Frontend/PrecompiledPreamble.cpp:490 PreprocessorOpts.DisablePCHValidation = true; + if (Storage.getKind() == PCHStorage::Kind::TempFile) { +const

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:206 + std::unique_ptr Storage; + if (InMemStorage) { +OS = llvm::make_unique(*InMemStorage); klimek wrote: > ilya-biryukov wrote: > > klimek wrote: > > > It looks like we

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-15 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: lib/Frontend/PrecompiledPreamble.cpp:206 + std::unique_ptr Storage; + if (InMemStorage) { +OS = llvm::make_unique(*InMemStorage); ilya-biryukov wrote: > klimek wrote: > > It looks like we should pass in the output

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Frontend/ASTUnit.cpp:1028 +IntrusiveRefCntPtr OldVFS = VFS; +Preamble->AddImplicitPreamble(*CCInvocation, /*ref*/ VFS, + OverrideMainBuffer.get()); klimek wrote: >

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-14 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 122838. ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. - Fixed comments. - Removed /*ref*/ annotations. - Removed unused "Storage" variable. - Extract a helper function that properly sets up VFS to access the PCHStorage.

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-10 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: include/clang/Frontend/PrecompiledPreamble.h:99 /// Changes options inside \p CI to use PCH from this preamble. Also remaps - /// main file to \p MainFileBuffer. + /// main file to \p MainFileBuffer and updates \p VFS to ensure

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. I'm really happy you've made this work! I don't understand it enough to do a meaningful review (keen to learn if you have time for a walkthrough when back in the office). https://reviews.llvm.org/D39842 ___ cfe-commits

[PATCH] D39842: Allow to store precompiled preambles in memory.

2017-11-09 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. 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