summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ModuleManager.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-11-21 05:37:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-11-21 05:37:20 +0000
commit5b39075668813a4b35dcc5ed6006fc1224ac2b19 (patch)
tree54b64235c52573cbcb17b20e555991c7abf132c4 /clang/lib/Serialization/ModuleManager.cpp
parente06124799b20ea006d7c32973c86f961f0dc396f (diff)
downloadbcm5719-llvm-5b39075668813a4b35dcc5ed6006fc1224ac2b19.tar.gz
bcm5719-llvm-5b39075668813a4b35dcc5ed6006fc1224ac2b19.zip
[modules] When explicitly importing a module, it's fine for the imported module
to be newer than we were expecting. That happens if .pcm's get moved between file systems during a distributed build. (It's still not OK for them to actually be different, though, so we still check the size and signature matches.) llvm-svn: 222507
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r--clang/lib/Serialization/ModuleManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp
index b5ee4145020..ac98ca0b872 100644
--- a/clang/lib/Serialization/ModuleManager.cpp
+++ b/clang/lib/Serialization/ModuleManager.cpp
@@ -67,6 +67,13 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
// Look for the file entry. This only fails if the expected size or
// modification time differ.
const FileEntry *Entry;
+ if (Type == MK_ExplicitModule) {
+ // 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
+ // contents, but we can't check that.)
+ ExpectedModTime = 0;
+ }
if (lookupModuleFile(FileName, ExpectedSize, ExpectedModTime, Entry)) {
ErrorStr = "module file out of date";
return OutOfDate;
OpenPOWER on IntegriCloud