[Lldb-commits] [PATCH] D39387: Invert ArchSpec<->Platform dependency

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 27 13:22:09 PDT 2017


labath created this revision.
Herald added subscribers: javed.absar, mgorny.

ArchSpec::SetTriple was taking a Platform as an argument, and used it to
fill in missing pieces of the specified triple. I invert the dependency
by moving this code to other classes. For this purpose, I've created
three new functions.

- HostInfo::GetAugmentedArchSpec: fills in the triple using the host platform (this used to be implemented by passing a null platform pointer). By putting this code in the Host module, we can provide a way to anyone who does not have a platform instance (lldb-server) an easy way to get Host data.
- Platform::GetAugmentedArchSpec: if you have a platform instance, you can call this to let it fill in the triple.
- static Platform::GetAugmentedArchSpec: implements the "if platform == 0 then use_host() else use_platform()" part.

After this change, it becomes possible to move the ArchSpec into the
Utility module, as it has no external dependencies.


https://reviews.llvm.org/D39387

Files:
  include/lldb/Core/ArchSpec.h
  include/lldb/Host/HostInfoBase.h
  include/lldb/Target/Platform.h
  source/API/SBDebugger.cpp
  source/API/SBInstruction.cpp
  source/API/SBTarget.cpp
  source/Commands/CommandObjectDisassemble.cpp
  source/Commands/CommandObjectPlatform.cpp
  source/Core/ArchSpec.cpp
  source/Host/common/HostInfoBase.cpp
  source/Interpreter/OptionGroupArchitecture.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  source/Target/Platform.cpp
  source/Target/Process.cpp
  unittests/Host/CMakeLists.txt
  unittests/Host/HostInfoTest.cpp
  unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
  unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39387.120685.patch
Type: text/x-patch
Size: 21698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171027/1bab5ab6/attachment-0001.bin>


More information about the lldb-commits mailing list