[PATCH] D34287: Moved code hanlding precompiled preamble out of the ASTUnit.

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 20 05:46:32 PDT 2017


klimek added inline comments.


================
Comment at: lib/Frontend/ASTUnit.cpp:131-136
+/// \brief Get a source buffer for \p MainFilePath, handling all file-to-file
+/// and file-to-buffer remappings inside \p Invocation.
+static PossiblyOwnedBuffer
+getBufferForFileHandlingRemapping(const CompilerInvocation &Invocation,
+                                  vfs::FileSystem *VFS,
+                                  StringRef FilePath) {
----------------
ilya-biryukov wrote:
> klimek wrote:
> > If this indeed needs to return a possibly owned buffer, explain when exactly it is owned and when it is unowned.
> Done. It's owned when read from disk and not owned when taken from CompilerInvocation.PPOptions' file-to-buffer remappings.
After some in person discussion, the idea now is to just always copy and return a unique_ptr


https://reviews.llvm.org/D34287





More information about the cfe-commits mailing list