================
@@ -5153,13 +5155,28 @@ ASTReader::ReadASTCore(StringRef FileName,
         << moduleKindForDiagnostic(Type) << FileName << !ErrorStr.empty()
         << ErrorStr;
     return Failure;
+  case ModuleManager::ExpectationNotMet:
+    if (!MC.isPCMFinal(FileName)) {
+      // The importer expected a different PCM. We don't know for sure whether
+      // it's this PCM that's out of date, or whether it's the importer and it
+      // therefore has out-of-date expectations.
+      // Let's defensively remove this PCM from the in-memory cache so that we
+      // are able to properly validate a fresh one later on.
+      MC.erasePCM(FileName);
+    }
----------------
jansvoboda11 wrote:

Because `tryToDropPCM()` would bring the state for this PCM to `ToBuild` or 
`Final`. To force re-loading fresh one from the disk, the state needs to be 
`Unknown`.

https://github.com/llvm/llvm-project/pull/177004
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to