summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-03-04 19:57:04 +0000
committerZachary Turner <zturner@google.com>2019-03-04 19:57:04 +0000
commitbb4d4e2d767b451c88d8f226d62ab7c81f46711b (patch)
tree6d02afc7857bf98690c649b87cd0f94e97a56b10
parent8670faf9394ed34ff894b0e784cdee4ba70d7837 (diff)
downloadbcm5719-llvm-bb4d4e2d767b451c88d8f226d62ab7c81f46711b.tar.gz
bcm5719-llvm-bb4d4e2d767b451c88d8f226d62ab7c81f46711b.zip
Fix Windows build after UserIDResolver patch.
That patch added a function to HostInfo that returns an instance of UserIDResolver, but this function was unimplemented on Windows, leading to linker errors. For now, just return a dummy implementation that doesn't resolve user ids to get the build green. llvm-svn: 355329
-rw-r--r--lldb/include/lldb/Host/HostInfoBase.h3
-rw-r--r--lldb/include/lldb/Host/posix/HostInfoPosix.h2
-rw-r--r--lldb/include/lldb/Host/windows/HostInfoWindows.h2
-rw-r--r--lldb/source/Host/windows/HostInfoWindows.cpp20
4 files changed, 24 insertions, 3 deletions
diff --git a/lldb/include/lldb/Host/HostInfoBase.h b/lldb/include/lldb/Host/HostInfoBase.h
index f2370f1d00a..a6fc2038ba4 100644
--- a/lldb/include/lldb/Host/HostInfoBase.h
+++ b/lldb/include/lldb/Host/HostInfoBase.h
@@ -11,7 +11,6 @@
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/UserIDResolver.h"
#include "lldb/lldb-enumerations.h"
#include "llvm/ADT/StringRef.h"
@@ -99,8 +98,6 @@ public:
//---------------------------------------------------------------------------
static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
- static UserIDResolver &GetUserIDResolver();
-
protected:
static bool ComputeSharedLibraryDirectory(FileSpec &file_spec);
static bool ComputeSupportExeDirectory(FileSpec &file_spec);
diff --git a/lldb/include/lldb/Host/posix/HostInfoPosix.h b/lldb/include/lldb/Host/posix/HostInfoPosix.h
index 2ae1415e030..c6f012bca72 100644
--- a/lldb/include/lldb/Host/posix/HostInfoPosix.h
+++ b/lldb/include/lldb/Host/posix/HostInfoPosix.h
@@ -14,6 +14,8 @@
namespace lldb_private {
+class UserIDResolver;
+
class HostInfoPosix : public HostInfoBase {
friend class HostInfoBase;
diff --git a/lldb/include/lldb/Host/windows/HostInfoWindows.h b/lldb/include/lldb/Host/windows/HostInfoWindows.h
index 3f0810527dc..209d9da0821 100644
--- a/lldb/include/lldb/Host/windows/HostInfoWindows.h
+++ b/lldb/include/lldb/Host/windows/HostInfoWindows.h
@@ -14,6 +14,7 @@
#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
+class UserIDResolver;
class HostInfoWindows : public HostInfoBase {
friend class HostInfoBase;
@@ -28,6 +29,7 @@ public:
static void Terminate();
static size_t GetPageSize();
+ static UserIDResolver &GetUserIDResolver();
static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
diff --git a/lldb/source/Host/windows/HostInfoWindows.cpp b/lldb/source/Host/windows/HostInfoWindows.cpp
index 033d6d844b4..8cd8f2d2fc5 100644
--- a/lldb/source/Host/windows/HostInfoWindows.cpp
+++ b/lldb/source/Host/windows/HostInfoWindows.cpp
@@ -14,15 +14,29 @@
#include "lldb/Host/windows/HostInfoWindows.h"
#include "lldb/Host/windows/PosixApi.h"
+#include "lldb/Utility/UserIDResolver.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"
using namespace lldb_private;
+namespace {
+class WindowsUserIDResolver : public UserIDResolver {
+protected:
+ llvm::Optional<std::string> DoGetUserName(id_t uid) override {
+ return llvm::None;
+ }
+ llvm::Optional<std::string> DoGetGroupName(id_t gid) override {
+ return llvm::None;
+ }
+};
+} // namespace
+
FileSpec HostInfoWindows::m_program_filespec;
void HostInfoWindows::Initialize() {
@@ -117,3 +131,9 @@ bool HostInfoWindows::GetEnvironmentVar(const std::string &var_name,
return llvm::convertWideToUTF8(wvar, var);
return false;
}
+
+static llvm::ManagedStatic<WindowsUserIDResolver> g_user_id_resolver;
+
+UserIDResolver &HostInfoWindows::GetUserIDResolver() {
+ return *g_user_id_resolver;
+}
OpenPOWER on IntegriCloud