Skip to content

Commit c85beb4

Browse files
authored
Merge branch 'main' into shared-module-list
2 parents 4c87ac5 + 09dbdf6 commit c85beb4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,14 @@ static bool compileModuleAndReadASTImpl(CompilerInstance &ImportingInstance,
14851485
return false;
14861486
}
14871487

1488+
// The module is built successfully, we can update its timestamp now.
1489+
if (ImportingInstance.getPreprocessor()
1490+
.getHeaderSearchInfo()
1491+
.getHeaderSearchOpts()
1492+
.ModulesValidateOncePerBuildSession) {
1493+
ImportingInstance.getModuleCache().updateModuleTimestamp(ModuleFileName);
1494+
}
1495+
14881496
return readASTAfterCompileModule(ImportingInstance, ImportLoc, ModuleNameLoc,
14891497
Module, ModuleFileName,
14901498
/*OutOfDate=*/nullptr, /*Missing=*/nullptr);

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5461,11 +5461,6 @@ ASTWriter::WriteAST(llvm::PointerUnion<Sema *, Preprocessor *> Subject,
54615461

54625462
WritingAST = false;
54635463

5464-
if (WritingModule && PPRef.getHeaderSearchInfo()
5465-
.getHeaderSearchOpts()
5466-
.ModulesValidateOncePerBuildSession)
5467-
ModCache.updateModuleTimestamp(OutputFile);
5468-
54695464
if (ShouldCacheASTInMemory) {
54705465
// Construct MemoryBuffer and update buffer manager.
54715466
ModCache.getInMemoryModuleCache().addBuiltPCM(

0 commit comments

Comments
 (0)