aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-05-19 10:01:43 -0700
committerJan Svoboda <jan_svoboda@apple.com>2025-05-19 10:40:55 -0700
commit7a242387c950c7060143da6da0e6fb91f36bb458 (patch)
tree8eb52a0390ea57a2ac909d72d66f5da493b7f3f4 /clang/lib/Frontend/CompilerInstance.cpp
parent1b44eb2f6b862fb171629321bf2f5ec231899c71 (diff)
downloadllvm-7a242387c950c7060143da6da0e6fb91f36bb458.zip
llvm-7a242387c950c7060143da6da0e6fb91f36bb458.tar.gz
llvm-7a242387c950c7060143da6da0e6fb91f36bb458.tar.bz2
Reland "[clang][modules] Timestamp-less validation API (#139987)"
This reverts commit 18b885f66babff3a10451bc811ffc077d61ed8ee, effectively reapplying #139987. This commit fixes unit tests (for example ASTUnitTest.SaveLoadPreservesLangOptionsInPrintingPolicy) where the `ASTUnit::ModCache` pointer dereferenced within `ASTUnit::serialize()` was null. This commit makes sure each factory function does initialize `ASTUnit::ModCache`.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 503d364..b3a23e6 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -72,7 +72,9 @@ CompilerInstance::CompilerInstance(
ModuleCache *ModCache)
: ModuleLoader(/*BuildingModule=*/ModCache),
Invocation(std::move(Invocation)),
- ModCache(ModCache ? ModCache : createCrossProcessModuleCache()),
+ ModCache(ModCache ? ModCache
+ : createCrossProcessModuleCache(
+ getHeaderSearchOpts().BuildSessionTimestamp)),
ThePCHContainerOperations(std::move(PCHContainerOps)) {
assert(this->Invocation && "Invocation must not be null");
}