================
@@ -71,14 +75,19 @@ bool InMemoryModuleCache::tryToDropPCM(llvm::StringRef 
Filename) {
   auto &PCM = I->second;
   assert(PCM.Buffer && "PCM to remove is scheduled to be built...");
 
-  if (PCM.IsFinal)
+  if (PCM.IsFinal) {
+    Logger.log() << "pcm_not_dropped: " << Filename;
----------------
qiongsiwu wrote:

The term comes from the enclosing method `nMemoryModuleCache::tryToDropPCM`. As 
far as I can tell this is only called in `ASTReader::ReadASTCore` to handle 
failure scenarios when `ShouldFinalizePCM` turns out to be false at exit. The 
intention is that we should log when we exit `ReadASTCore`, and indicate if the 
read is successful  (the case we call `MC.finalizePCM(FileName)`), or if it is 
not (the case we call `MC.tryToDropPCM(FileName)`). I don't think a lit test 
against this failure case is very easy to add, but I can add a unit test 
(adding some files but do not finalize them in the module cache to artificially 
trigger the failure in the unit test) if that is desirable. 

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

Reply via email to