arphaman added inline comments.

================
Comment at: 
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp:156
+/// this subclass.
+class MinimizedVFSFile final : public llvm::vfs::File {
+public:
----------------
aganea wrote:
> This makes only a short-lived objects, is that right? Just during the call to 
> `CachedFileSystemEntry::createFileEntry`?
 Yes, these VFS buffer files are only alive for a particular invocation.


================
Comment at: 
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp:148
+  RealFS = new ProxyFileSystemWithoutChdir(llvm::vfs::getRealFileSystem());
+  if (Service.getMode() == ScanningMode::MinimizedSourcePreprocessing)
+    DepFS = new DependencyScanningFilesystem(Service.getSharedCache(), RealFS);
----------------
aganea wrote:
> arphaman wrote:
> > aganea wrote:
> > > Can we not use caching all the time?
> > We want to have a mode where it's as close to the regular `clang -E` 
> > invocation as possible for correctness CI and testing. We also haven't 
> > evaluated if the cost of keeping non-minimized sources in memory, so it 
> > might be too expensive for practical use? I can add a third option that 
> > caches but doesn't minimize though as a follow-up patch though 
> > 
> Yes that would be nice. As for the size taken in RAM, it would be only .H 
> files, right? For Clang+LLVM+LLD I'm counting about 40 MB. But indeed with a 
> large project, that would be about 1.5 GB of .H. Although I doubt all these 
> files will be loaded at once in memory (I'll check)
> 
> As for the usage: Fastbuild works like distcc (plain mode, not pump) so we 
> were also planning on extracting the fully preprocessed output, not only the 
> dependencies. There's one use-case where we need to preprocess locally, then 
> send the preprocessed output remotely for compilation. And another use-case 
> where we only want to extract the dependency list, compute a digest, to 
> retrieve the OBJ from a network cache.
Right now it doesn't differentiate between .H and other files, but we could 
teach it do have a header only filter for the cache.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63907/new/

https://reviews.llvm.org/D63907



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to