]> granicus.if.org Git - clang/commitdiff
[Modules] Rebuild modules on umbrella header mismatch
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 22 Mar 2017 00:11:21 +0000 (00:11 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 22 Mar 2017 00:11:21 +0000 (00:11 +0000)
This restores behavior pre-r230064 since after PCMCache work (r298278)
we don't reload PCMs from disk within the same compiler invocation.

Testcases from r230064 are still left around since they still guarantee
the correct behavior we're expecting.

rdar://problem/19889777

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298464 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp

index d9033c830a857f85f5a1490080791e364d5b6fcc..c6b21aadbdd63192bcb79b2483281999c4919710 100644 (file)
@@ -4890,13 +4890,9 @@ ASTReader::ReadSubmoduleBlock(ModuleFile &F, unsigned ClientLoadCapabilities) {
         if (!CurrentModule->getUmbrellaHeader())
           ModMap.setUmbrellaHeader(CurrentModule, Umbrella, Blob);
         else if (CurrentModule->getUmbrellaHeader().Entry != Umbrella) {
-          // This can be a spurious difference caused by changing the VFS to
-          // point to a different copy of the file, and it is too late to
-          // to rebuild safely.
-          // FIXME: If we wrote the virtual paths instead of the 'real' paths,
-          // after input file validation only real problems would remain and we
-          // could just error. For now, assume it's okay.
-          break;
+          if ((ClientLoadCapabilities & ARR_OutOfDate) == 0)
+            Error("mismatched umbrella headers in submodule");
+          return OutOfDate;
         }
       }
       break;