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

Cameron via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 14:48:45 PDT 2016


cameron314 created this revision.
cameron314 added a reviewer: rsmith.
cameron314 added a subscriber: cfe-commits.

There were two bugs relating to remapped files, that are not specific to Windows but happen more often there:
- When remapped files were changed, they would never cause the preamble's PCH to be invalidated, because the remapped path didn't necessarily match the include path (e.g. slash direction). I fixed this by moving to a `llvm::sys::fs::UniqueID`-based map instead of using strings for paths and hoping they match.
- Fixing the above bug revealed a new bug where remapped files would always cause the preamble's PCH to be invalidated (even if they hadn't changed) because the file manager was replacing the remapped virtual entry (no modified time) with a real file entry (which has a modified time) when the include directive was processed, again because it had a slightly different path due to slash direction.

http://reviews.llvm.org/D20137

Files:
  include/clang/Basic/FileManager.h
  include/clang/Frontend/ASTUnit.h
  lib/Basic/FileManager.cpp
  lib/Frontend/ASTUnit.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20137.56820.patch
Type: text/x-patch
Size: 6986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160510/3f5eeb7f/attachment.bin>


More information about the cfe-commits mailing list