[PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

Cameron via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 10:02:17 PDT 2016

cameron314 added inline comments.

Comment at: lib/Frontend/ASTUnit.cpp:1402-1406
@@ +1401,7 @@
+        vfs::Status Status;
+        if (FileMgr->getNoncachedStatValue(RB.first, Status)) {
+          AnyFileChanged = true;
+          break;
+        }
rsmith wrote:
> Suppose file names A and B refer to file (inode) X, and the map contains X -> (A, hash). If B is deleted (and maybe recreated pointing at a new inode), this approach won't detect that anything has changed.
Ah, I understand. The problem isn't really with the overridden file map, which still has to be by inode in order for lookups to find the right file regardless of name, but with the FilesInPreamble map, which needs to stay as a list of independent filenames in case the inodes associated to those filenames changes in between parses.

I'll make the change, thanks!


More information about the cfe-commits mailing list