diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-03-14 11:32:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-14 11:32:39 -0700 |
commit | c84d8e8f1c406ab34d56efd4a9f8c5fbce70af2d (patch) | |
tree | 869fe558fc328f610628c697c2006a91f7581ec1 /clang/lib/Frontend/PrecompiledPreamble.cpp | |
parent | d0a0de50f7dc6f116863ea9e8ca11efc2dc9f71e (diff) | |
download | llvm-c84d8e8f1c406ab34d56efd4a9f8c5fbce70af2d.zip llvm-c84d8e8f1c406ab34d56efd4a9f8c5fbce70af2d.tar.gz llvm-c84d8e8f1c406ab34d56efd4a9f8c5fbce70af2d.tar.bz2 |
[clang][modules] Introduce new `ModuleCache` interface (#131193)
This PR adds new `ModuleCache` interface to Clang's implicitly-built
modules machinery. The main motivation for this change is to create a
second implementation that uses a more efficient kind of
`llvm::AdvisoryLock` during dependency scanning.
In addition to the lock abstraction, the `ModuleCache` interface also
manages the existing `InMemoryModuleCache` instance. I found that
compared to keeping these separate/independent, the code is a bit
simpler now, since these are two tightly coupled concepts. I can
envision a more efficient implementation of the `InMemoryModuleCache`
for the single-process case too, which will be much easier to implement
with the current setup.
This is not intended to be a functional change.
Diffstat (limited to 'clang/lib/Frontend/PrecompiledPreamble.cpp')
-rw-r--r-- | clang/lib/Frontend/PrecompiledPreamble.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp index d1bac09..49fa2e9 100644 --- a/clang/lib/Frontend/PrecompiledPreamble.cpp +++ b/clang/lib/Frontend/PrecompiledPreamble.cpp @@ -292,10 +292,9 @@ private: class PrecompilePreambleConsumer : public PCHGenerator { public: PrecompilePreambleConsumer(PrecompilePreambleAction &Action, Preprocessor &PP, - InMemoryModuleCache &ModuleCache, - StringRef isysroot, + ModuleCache &ModCache, StringRef isysroot, std::shared_ptr<PCHBuffer> Buffer) - : PCHGenerator(PP, ModuleCache, "", isysroot, std::move(Buffer), + : PCHGenerator(PP, ModCache, "", isysroot, std::move(Buffer), ArrayRef<std::shared_ptr<ModuleFileExtension>>(), /*AllowASTWithErrors=*/true), Action(Action) {} |