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
https://reviews.llvm.o
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 "llvm/Support/CrashRecoveryConte
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
cfe/t
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___");
il
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
lib/Frontend/FrontendAct
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
include/clang/Frontend/PrecompiledPreamble
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___");
kl
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___");
ilya-biry
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___");
kl
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___");
ilya-biry
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___");
kl
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
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
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 s
ilya-biryukov added inline comments.
Comment at: lib/Frontend/ASTUnit.cpp:1028
+IntrusiveRefCntPtr OldVFS = VFS;
+Preamble->AddImplicitPreamble(*CCInvocation, /*ref*/ VFS,
+ OverrideMainBuffer.get());
klimek wrote:
> Since
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.
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 pream
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 m
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
ASTUnit
19 matches
Mail list logo