[PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

Cameron via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 07:23:18 PDT 2016


cameron314 added a comment.

Thanks @bruno, I'll have a look at using a VFS for the test.


================
Comment at: lib/Basic/FileManager.cpp:389
@@ -383,2 +388,3 @@
   UFE->File.reset();
+  UFE->IsVirtual = true;
   return UFE;
----------------
rsmith wrote:
> Rather than adding this `IsVirtual` flag, could you just set `UFE->IsValid` to `true` here?  It looks like a simple oversight that this code fails to set the `IsValid` flag properly.
I could, but I didn't want to accidentally break something else that depends on virtual files not being valid. That's the type of change that can easily introduce a subtle bug not caught by the tests.

Semantically, is a virtual file always valid?


Repository:
  rL LLVM

http://reviews.llvm.org/D20338





More information about the cfe-commits mailing list