From 298ae5574ddd926e67c14f1384fbf523f2f3c7a8 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Wed, 11 Dec 2024 10:11:30 -0800 Subject: [PATCH] Revert "[Modules] Process include files changes (#90319)" This reverts commit 9a9cff15a15b103ae1dc1efa98b53901cdda78f1, which combined with CAS (where every file has a 0 mtime), causes content validation to run on every input file. (cherry picked from commit ffe014a999bc5aff09310e7e4dd6bc42d5476e27) --- clang/lib/Serialization/ASTReader.cpp | 8 ----- .../Modules/implicit-module-no-timestamp.cpp | 33 ------------------- 2 files changed, 41 deletions(-) delete mode 100644 clang/test/Modules/implicit-module-no-timestamp.cpp diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index eba83f20befc7..d68cef0f7e5bb 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2671,14 +2671,6 @@ InputFile ASTReader::getInputFile(ModuleFile &F, unsigned ID, bool Complain) { F.StandardCXXModule && FileChange.Kind == Change::None) FileChange = HasInputContentChanged(FileChange); - // When we have StoredTime equal to zero and ValidateASTInputFilesContent, - // it is better to check the content of the input files because we cannot rely - // on the file modification time, which will be the same (zero) for these - // files. - if (!StoredTime && ValidateASTInputFilesContent && - FileChange.Kind == Change::None) - FileChange = HasInputContentChanged(FileChange); - // For an overridden file, there is nothing to validate. if (!Overridden && FileChange.Kind != Change::None) { if (Complain && !Diags.isDiagnosticInFlight()) { diff --git a/clang/test/Modules/implicit-module-no-timestamp.cpp b/clang/test/Modules/implicit-module-no-timestamp.cpp deleted file mode 100644 index 50767b4a11468..0000000000000 --- a/clang/test/Modules/implicit-module-no-timestamp.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// RUN: rm -rf %t -// RUN: split-file %s %t -// RUN: cd %t -// -// RUN: cp a1.h a.h -// RUN: %clang_cc1 -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=%t test1.cpp -// RUN: cp a2.h a.h -// RUN: %clang_cc1 -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=%t test2.cpp - -//--- a1.h -#define FOO - -//--- a2.h -#define BAR - -//--- module.modulemap -module a { - header "a.h" -} - -//--- test1.cpp -#include "a.h" - -#ifndef FOO -#error foo -#endif - -//--- test2.cpp -#include "a.h" - -#ifndef BAR -#error bar -#endif