diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2025-04-23 10:55:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-23 10:55:39 -0700 |
commit | 3c9027c1d7aac0c1e54af13182f1b8f58d376115 (patch) | |
tree | 8fb7a9c1c2d376c4b69f3d6234c74ae272391d2e /clang/lib/Serialization/ModuleManager.cpp | |
parent | 0f5965fa9c67969e4de7374362b6af49bf400b3b (diff) | |
download | llvm-3c9027c1d7aac0c1e54af13182f1b8f58d376115.zip llvm-3c9027c1d7aac0c1e54af13182f1b8f58d376115.tar.gz llvm-3c9027c1d7aac0c1e54af13182f1b8f58d376115.tar.bz2 |
[clang][Modules] Clarify error message when size check fails in lookupModuleFile
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 8 |
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; } |