[FileSystem] Extend file system and have it use the VFS.

This patch extends the FileSystem class with a bunch of functions that
are currently implemented as methods of the FileSpec class. These
methods will be removed in future commits and replaced by calls to the
file system.

The new functions are operated in terms of the virtual file system which
was recently moved from clang into LLVM so it could be reused in lldb.
Because the VFS is stateful, we turned the FileSystem class into a
singleton.

Differential revision: https://reviews.llvm.org/D53532

llvm-svn: 345783
This commit is contained in:
Jonas Devlieghere
2018-10-31 21:49:27 +00:00
parent 063fd98bcc
commit 46376966ea
32 changed files with 632 additions and 68 deletions

View File

@@ -14,6 +14,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/Section.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Compression.h"
@@ -29,6 +30,7 @@ using namespace lldb;
class ObjectFileELFTest : public testing::Test {
public:
void SetUp() override {
FileSystem::Initialize();
HostInfo::Initialize();
ObjectFileELF::Initialize();
SymbolVendorELF::Initialize();
@@ -38,6 +40,7 @@ public:
SymbolVendorELF::Terminate();
ObjectFileELF::Terminate();
HostInfo::Terminate();
FileSystem::Terminate();
}
protected: