[PATCH] Some infrastructure work for virtual file system (now on phab)

Ben Langmuir blangmuir at apple.com
Fri Feb 14 06:50:14 PST 2014



================
Comment at: lib/Basic/VirtualFileSystem.cpp:62-83
@@ +61,24 @@
+
+ErrorOr<AbstractFileSystem::Status>
+AbstractFileSystem::status(AbstractFileSystem::FileDescriptor FD) {
+  // FIXME: when we support virtual files, use information from the FD to lookup
+  // which AbstractFileSystem to perform this operation on.
+  return getRealFileSystem()->statusOfOpenFile(FD);
+}
+
+error_code AbstractFileSystem::getBufferForFile(
+    FileDescriptor FD, const llvm::Twine &Name,
+    llvm::OwningPtr<llvm::MemoryBuffer> &Result, int64_t FileSize,
+    bool RequiresNullTerminator) {
+  // FIXME: when we support virtual files, use information from the FD to lookup
+  // which AbstractFileSystem to perform this operation on.
+  return getRealFileSystem()->getBufferForOpenFile(FD, Name, Result, FileSize,
+                                                   RequiresNullTerminator);
+}
+
+error_code AbstractFileSystem::close(AbstractFileSystem::FileDescriptor FD) {
+  // FIXME: when we support virtual files, use information from the FD to lookup
+  // which AbstractFileSystem to perform this operation on.
+  return getRealFileSystem()->closeOpenFile(FD);
+}
+
----------------
Manuel Klimek wrote:
> I'd have expected this->*OpenFile(...) calls in those methods.
These methods take a file descriptor as a parameter, so the file is already open.


http://llvm-reviews.chandlerc.com/D2745



More information about the cfe-commits mailing list