cameron314 added inline comments.

================
Comment at: include/clang/Frontend/PrecompiledPreamble.h:100
 
   /// PreambleBounds used to build the preamble
   PreambleBounds getBounds() const;
----------------
ilya-biryukov wrote:
> Not introduced by this change, but could you also add a full stop here for 
> constistency?
Sure.


================
Comment at: include/clang/Frontend/PrecompiledPreamble.h:103
 
+  /// The temporary file path at which the preamble PCH was placed
+  StringRef GetPCHPath() const { return PCHFile.getFilePath(); }
----------------
ilya-biryukov wrote:
> NIT: comment should end with a full stop.
OK!


================
Comment at: lib/Frontend/ASTUnit.cpp:1021
+  if (Buf)
+    PCHFS->addFile(PCHFilename, 0, std::move(*Buf));
+  IntrusiveRefCntPtr<vfs::OverlayFileSystem>
----------------
ilya-biryukov wrote:
> Maybe return original `VFS` if `PCHFilename` could not be read and not create 
> any empty overlays?
Makes sense, will do.


================
Comment at: lib/Frontend/ASTUnit.cpp:1053
+  IntrusiveRefCntPtr<vfs::FileSystem> RealFS = vfs::getRealFileSystem();
+  if (OverrideMainBuffer && VFS && RealFS && VFS != RealFS &&
+      !VFS->exists(Preamble->GetPCHPath())) {
----------------
ilya-biryukov wrote:
> The check `&& RealFS` is redundant and can be removed.
It's not redundant, but looking at the implementation of 
`vfs::getRealFileSystem` it will always return a non-null pointer.


https://reviews.llvm.org/D37474



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to