Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/lldb/Host/FileSystem.h b/linux-x64/clang/include/lldb/Host/FileSystem.h
index 865b09b..02ff5f3 100644
--- a/linux-x64/clang/include/lldb/Host/FileSystem.h
+++ b/linux-x64/clang/include/lldb/Host/FileSystem.h
@@ -6,17 +6,17 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Host_FileSystem_h
-#define liblldb_Host_FileSystem_h
+#ifndef LLDB_HOST_FILESYSTEM_H
+#define LLDB_HOST_FILESYSTEM_H
#include "lldb/Host/File.h"
#include "lldb/Utility/DataBufferLLVM.h"
-#include "lldb/Utility/FileCollector.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Status.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Chrono.h"
+#include "llvm/Support/FileCollector.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "lldb/lldb-types.h"
@@ -33,13 +33,14 @@
FileSystem()
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr),
- m_mapped(false) {}
- FileSystem(FileCollector &collector)
- : m_fs(llvm::vfs::getRealFileSystem()), m_collector(&collector),
- m_mapped(false) {}
+ m_home_directory(), m_mapped(false) {}
+ FileSystem(std::shared_ptr<llvm::FileCollectorBase> collector)
+ : m_fs(llvm::vfs::getRealFileSystem()), m_collector(std::move(collector)),
+ m_home_directory(), m_mapped(false) {}
FileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs,
bool mapped = false)
- : m_fs(fs), m_collector(nullptr), m_mapped(mapped) {}
+ : m_fs(std::move(fs)), m_collector(nullptr), m_home_directory(),
+ m_mapped(mapped) {}
FileSystem(const FileSystem &fs) = delete;
FileSystem &operator=(const FileSystem &fs) = delete;
@@ -47,7 +48,7 @@
static FileSystem &Instance();
static void Initialize();
- static void Initialize(FileCollector &collector);
+ static void Initialize(std::shared_ptr<llvm::FileCollectorBase> collector);
static llvm::Error Initialize(const FileSpec &mapping);
static void Initialize(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs);
static void Terminate();
@@ -63,9 +64,10 @@
/// Wraps ::open in a platform-independent way.
int Open(const char *path, int flags, int mode);
- Status Open(File &File, const FileSpec &file_spec, uint32_t options,
- uint32_t permissions = lldb::eFilePermissionsFileDefault,
- bool should_close_fd = true);
+ llvm::Expected<std::unique_ptr<File>>
+ Open(const FileSpec &file_spec, File::OpenOptions options,
+ uint32_t permissions = lldb::eFilePermissionsFileDefault,
+ bool should_close_fd = true);
/// Get a directory iterator.
/// \{
@@ -153,6 +155,10 @@
/// Call into the Host to see if it can help find the file.
bool ResolveExecutableLocation(FileSpec &file_spec);
+ /// Get the user home directory.
+ bool GetHomeDirectory(llvm::SmallVectorImpl<char> &path) const;
+ bool GetHomeDirectory(FileSpec &file_spec) const;
+
enum EnumerateDirectoryResult {
/// Enumerate next entry in the current directory.
eEnumerateDirectoryResultNext,
@@ -185,10 +191,16 @@
return m_fs;
}
+ void Collect(const FileSpec &file_spec);
+ void Collect(const llvm::Twine &file);
+
+ void SetHomeDirectory(std::string home_directory);
+
private:
static llvm::Optional<FileSystem> &InstanceImpl();
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> m_fs;
- FileCollector *m_collector;
+ std::shared_ptr<llvm::FileCollectorBase> m_collector;
+ std::string m_home_directory;
bool m_mapped;
};
} // namespace lldb_private