aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ModuleManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r--clang/lib/Serialization/ModuleManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp
index 61c4e9e..d466ea0 100644
--- a/clang/lib/Serialization/ModuleManager.cpp
+++ b/clang/lib/Serialization/ModuleManager.cpp
@@ -110,7 +110,9 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
// Look for the file entry. This only fails if the expected size or
// modification time differ.
OptionalFileEntryRef Entry;
- if (Type == MK_ExplicitModule || Type == MK_PrebuiltModule) {
+ const bool IgnoreModTime =
+ (Type == MK_ExplicitModule || Type == MK_PrebuiltModule);
+ if (IgnoreModTime) {
// If we're not expecting to pull this file out of the module cache, it
// might have a different mtime due to being moved across filesystems in
// a distributed build. The size must still match, though. (As must the
@@ -120,7 +122,9 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
// Note: ExpectedSize and ExpectedModTime will be 0 for MK_ImplicitModule
// when using an ASTFileSignature.
if (lookupModuleFile(FileName, ExpectedSize, ExpectedModTime, Entry)) {
- ErrorStr = "module file has a different size or mtime than expected";
+ ErrorStr = IgnoreModTime
+ ? "module file has a different size than expected"
+ : "module file has a different size or mtime than expected";
return OutOfDate;
}