[llvm-branch-commits] [clang] release/22.x: [clang][modules] Read PCM validation timestamp earlier (#177062) (PR #177383)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 22 07:49:02 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: None (llvmbot)
<details>
<summary>Changes</summary>
Backport ada79f4
Requested by: @<!-- -->jansvoboda11
---
Full diff: https://github.com/llvm/llvm-project/pull/177383.diff
1 Files Affected:
- (modified) clang/lib/Serialization/ModuleManager.cpp (+5-5)
``````````diff
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp
index 236fe20fdad7c..dad6840947ece 100644
--- a/clang/lib/Serialization/ModuleManager.cpp
+++ b/clang/lib/Serialization/ModuleManager.cpp
@@ -105,6 +105,10 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
std::string &ErrorStr) {
Module = nullptr;
+ uint64_t InputFilesValidationTimestamp = 0;
+ if (Type == MK_ImplicitModule)
+ InputFilesValidationTimestamp = ModCache.getModuleTimestamp(FileName);
+
// Look for the file entry. This only fails if the expected size or
// modification time differ.
OptionalFileEntryRef Entry;
@@ -172,11 +176,7 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
NewModule->Index = Chain.size();
NewModule->FileName = FileName.str();
NewModule->ImportLoc = ImportLoc;
- NewModule->InputFilesValidationTimestamp = 0;
-
- if (NewModule->Kind == MK_ImplicitModule)
- NewModule->InputFilesValidationTimestamp =
- ModCache.getModuleTimestamp(NewModule->FileName);
+ NewModule->InputFilesValidationTimestamp = InputFilesValidationTimestamp;
// Load the contents of the module
if (std::unique_ptr<llvm::MemoryBuffer> Buffer = lookupBuffer(FileName)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/177383
More information about the llvm-branch-commits
mailing list