This is an archive of the discontinued LLVM Phabricator instance.

WIP: clang-scan-deps: Skip the disk when scanning modules dependencies
Needs ReviewPublic

Authored by dexonsmith on Jan 28 2021, 8:48 AM.

Details

Summary

Modules dependendency scanning builds lightweight modules (based on
minimized preprocess-only sources) in order to construct the module
dependency graph. Add -intercept-module-outputs (on-by-default), which
keeps these lightweight modules in memory instead of writing to and
reading from disk, leveraging llvm::vfs::OutputManager.

This patch uses a separate cache per worker, but these would ideally be
kept in a shared result cache (could be an in-memory CAS).

This is a WIP because it's based on the OutputManager RFC (see patches https://reviews.llvm.org/D95501 / https://reviews.llvm.org/D95502) but I'm posting this as well since it's a simple example usage.

I haven't benchmarked (yet); it's motivated by profiling from a couple of years ago that showed some slowdowns here.

Diff Detail