Skip to content

Commit e94f31b

Browse files
Updated according to new HostInfoPosix
1 parent d05de47 commit e94f31b

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed

lldb/include/lldb/Host/aix/HostInfoAIX.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
#include "llvm/ADT/StringRef.h"
1515
#include "llvm/Support/VersionTuple.h"
1616

17-
#include <optional>
18-
#include <string>
19-
2017
namespace lldb_private {
2118

2219
class HostInfoAIX : public HostInfoPosix {
@@ -26,15 +23,10 @@ class HostInfoAIX : public HostInfoPosix {
2623
static void Initialize(SharedLibraryDirectoryHelper *helper = nullptr);
2724
static void Terminate();
2825

29-
static llvm::VersionTuple GetOSVersion();
30-
static std::optional<std::string> GetOSBuildString();
3126
static llvm::StringRef GetDistributionId();
3227
static FileSpec GetProgramFileSpec();
3328

3429
protected:
35-
static bool ComputeSupportExeDirectory(FileSpec &file_spec);
36-
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
37-
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
3830
static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
3931
ArchSpec &arch_64);
4032
};

lldb/source/Host/aix/HostInfoAIX.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222

2323
#include <algorithm>
2424
#include <mutex>
25-
#include <optional>
2625

2726
using namespace lldb_private;
2827

2928
namespace {
3029
struct HostInfoAIXFields {
3130
llvm::once_flag m_distribution_once_flag;
3231
std::string m_distribution_id;
33-
llvm::once_flag m_os_version_once_flag;
34-
llvm::VersionTuple m_os_version;
3532
};
3633
} // namespace
3734

@@ -50,33 +47,6 @@ void HostInfoAIX::Terminate() {
5047
HostInfoBase::Terminate();
5148
}
5249

53-
llvm::VersionTuple HostInfoAIX::GetOSVersion() {
54-
assert(g_fields && "Missing call to Initialize?");
55-
llvm::call_once(g_fields->m_os_version_once_flag, []() {
56-
struct utsname un;
57-
if (uname(&un) != 0)
58-
return;
59-
60-
llvm::StringRef release = un.release;
61-
// The kernel release string can include a lot of stuff (e.g.
62-
// 4.9.0-6-amd64). We're only interested in the numbered prefix.
63-
release = release.substr(0, release.find_first_not_of("0123456789."));
64-
g_fields->m_os_version.tryParse(release);
65-
});
66-
67-
return g_fields->m_os_version;
68-
}
69-
70-
std::optional<std::string> HostInfoAIX::GetOSBuildString() {
71-
struct utsname un;
72-
::memset(&un, 0, sizeof(utsname));
73-
74-
if (uname(&un) < 0)
75-
return std::nullopt;
76-
77-
return std::string(un.release);
78-
}
79-
8050
llvm::StringRef HostInfoAIX::GetDistributionId() {
8151
assert(g_fields && "Missing call to Initialize?");
8252
// Try to run 'lbs_release -i', and use that response for the distribution
@@ -167,35 +137,6 @@ FileSpec HostInfoAIX::GetProgramFileSpec() {
167137
return g_program_filespec;
168138
}
169139

170-
bool HostInfoAIX::ComputeSupportExeDirectory(FileSpec &file_spec) {
171-
if (HostInfoPosix::ComputeSupportExeDirectory(file_spec) &&
172-
file_spec.IsAbsolute() && FileSystem::Instance().Exists(file_spec))
173-
return true;
174-
file_spec.SetDirectory(GetProgramFileSpec().GetDirectory());
175-
return !file_spec.GetDirectory().IsEmpty();
176-
}
177-
178-
bool HostInfoAIX::ComputeSystemPluginsDirectory(FileSpec &file_spec) {
179-
FileSpec temp_file("/usr/" LLDB_INSTALL_LIBDIR_BASENAME "/lldb/plugins");
180-
FileSystem::Instance().Resolve(temp_file);
181-
file_spec.SetDirectory(temp_file.GetPath());
182-
return true;
183-
}
184-
185-
bool HostInfoAIX::ComputeUserPluginsDirectory(FileSpec &file_spec) {
186-
// XDG Base Directory Specification
187-
// http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html If
188-
// XDG_DATA_HOME exists, use that, otherwise use ~/.local/share/lldb.
189-
const char *xdg_data_home = getenv("XDG_DATA_HOME");
190-
if (xdg_data_home && xdg_data_home[0]) {
191-
std::string user_plugin_dir(xdg_data_home);
192-
user_plugin_dir += "/lldb";
193-
file_spec.SetDirectory(user_plugin_dir.c_str());
194-
} else
195-
file_spec.SetDirectory("~/.local/share/lldb");
196-
return true;
197-
}
198-
199140
void HostInfoAIX::ComputeHostArchitectureSupport(ArchSpec &arch_32,
200141
ArchSpec &arch_64) {
201142
HostInfoPosix::ComputeHostArchitectureSupport(arch_32, arch_64);

0 commit comments

Comments
 (0)