aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/PrecompiledPreamble.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-03-14 11:32:39 -0700
committerGitHub <noreply@github.com>2025-03-14 11:32:39 -0700
commitc84d8e8f1c406ab34d56efd4a9f8c5fbce70af2d (patch)
tree869fe558fc328f610628c697c2006a91f7581ec1 /clang/lib/Frontend/PrecompiledPreamble.cpp
parentd0a0de50f7dc6f116863ea9e8ca11efc2dc9f71e (diff)
downloadllvm-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.cpp5
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) {}