diff options
author | Zachary Turner <zturner@google.com> | 2014-08-19 17:18:29 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-08-19 17:18:29 +0000 |
commit | 97a14e60b29c6940238410f0e8221b113a4a78d5 (patch) | |
tree | 16210d9ad28e121ef9b0ffa6d22132f7c866c346 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 91b2fa2a9a2ae436a84216af81bc62699a2bcfa4 (diff) | |
download | bcm5719-llvm-97a14e60b29c6940238410f0e8221b113a4a78d5.tar.gz bcm5719-llvm-97a14e60b29c6940238410f0e8221b113a4a78d5.zip |
Move some Host logic into HostInfo class.
This patch creates a HostInfo class, a static class used to answer
basic queries about the host platform. As part of this change,
some functionality is moved from Host to HostInfo, and relevant
fixups are performed in the rest of the codebase.
This is part of a larger effort to isolate more code in the Host
layer into platform-specific groups, to make it easier to make
platform specific changes for a particular Host without breaking
other hosts.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D4963
llvm-svn: 215992
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d9acc996ca2..606d1f879f1 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -28,8 +28,10 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/MathExtras.h" #define CASE_AND_STREAM(s, def, width) \ @@ -1277,8 +1279,8 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, const ArchSpec host_arch32 = Host::GetArchitecture (Host::eSystemDefaultArchitecture32); if (host_arch32.GetCore() == arch_spec.GetCore()) { - arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); - arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); + arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data()); } } break; @@ -1287,8 +1289,8 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, const ArchSpec host_arch64 = Host::GetArchitecture (Host::eSystemDefaultArchitecture64); if (host_arch64.GetCore() == arch_spec.GetCore()) { - arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); - arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); + arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data()); } } break; |