This is an archive of the discontinued LLVM Phabricator instance.

Move FileSystem functions from Host to their own class
ClosedPublic

Authored by zturner on Aug 13 2014, 1:29 PM.

Details

Summary

As part of an effort to make Host not be such a monolithic, catch-all class, this patch moves file system logic out of Host and into a smaller, more appropriate class, which is also in the Host layer. More specifically, this patch makes the following changes:

  1. Creates an lldbHostPosix library which can is useful for containing code which can compile and link on any posix-compliant platform
  2. Creates Host/FileSystem.h which defines a common file system interface
  3. Implements FileSystem.h in Host/windows/FileSystem.cpp and Host/posix/FileSystem.cpp
  4. Creates Host/FileCache.h and Host/common/FileCache.cpp, which defines a class useful for storing handles to open files needed by the debugger

Tested on Windows and Linux using CMake. There are probably outstanding issues with the Mac build, as I don't have that setup yet. In particular, Mac build will need to create the lldbHostPosix library, link against it, and add the new files to the Xcode project.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 12467.Aug 13 2014, 1:29 PM
zturner retitled this revision from to Move FileSystem functions from Host to their own class.
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added a subscriber: Unknown Object (MLST).
zturner updated this revision to Diff 12522.Aug 14 2014, 1:21 PM

Updated the Xcode project and confirmed that all tests pass on MacOSX and Linux.

Will submit this tomorrow unless there's objections.

zturner closed this revision.Aug 15 2014, 3:13 PM
zturner updated this revision to Diff 12575.

Closed by commit rL215775 (authored by @zturner).