Skip to content

Commit e14e6a6

Browse files
committed
[clang][Modules] Clarify error message when size check fails in lookupModuleFile
(cherry picked from commit 3c9027c)
1 parent d03a4ce commit e14e6a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/Serialization/ModuleManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
134134
// Note: ExpectedSize and ExpectedModTime will be 0 for MK_ImplicitModule
135135
// when using an ASTFileSignature.
136136
if (lookupModuleFile(FileName, ExpectedSize, ExpectedModTime, Entry)) {
137-
ErrorStr = "module file out of date";
137+
ErrorStr = IgnoreModTime
138+
? "module file has a different size than expected"
139+
: "module file has a different size or mtime than expected";
138140
return OutOfDate;
139141
}
140142

clang/test/Modules/explicit-build.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,6 @@
199199
// RUN: -fmodule-file=%t/c.pcm \
200200
// RUN: %s -DHAVE_A -DHAVE_B -DHAVE_C 2>&1 | FileCheck --check-prefix=CHECK-MISMATCHED-B %s
201201
//
202-
// CHECK-MISMATCHED-B: fatal error: module file '{{.*}}b.pcm' is out of date and needs to be rebuilt: module file out of date
202+
// CHECK-MISMATCHED-B: fatal error: module file '{{.*}}b.pcm' is out of date and needs to be rebuilt: module file has a different size than expected
203203
// CHECK-MISMATCHED-B-NEXT: note: imported by module 'c'
204204
// CHECK-MISMATCHED-B-NOT: note:

0 commit comments

Comments
 (0)