diff options
| author | Pavel Labath <pavel@labath.sk> | 2019-09-25 13:03:04 +0000 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2019-09-25 13:03:04 +0000 |
| commit | d0b44dbefd140949fed7916dc33e19f7c86b2cfd (patch) | |
| tree | 318a6e9e16ef40497b6e766535ecde4bfa6fc796 /lldb/source/Plugins/ABI/SysV-hexagon | |
| parent | 7f9ac3372ccb85fbe652276d4081c9c64dfb3836 (diff) | |
| download | bcm5719-llvm-d0b44dbefd140949fed7916dc33e19f7c86b2cfd.tar.gz bcm5719-llvm-d0b44dbefd140949fed7916dc33e19f7c86b2cfd.zip | |
Have ABI plugins vend llvm MCRegisterInfo data
Summary:
I was recently surprised to learn that there is a total of 2 (two) users
of the register info definitions contained in the ABI plugins. Yet, the
defitions themselves span nearly 10kLOC.
The two users are:
- dwarf expression pretty printer
- the mechanism for augmenting the register info definitions obtained
over gdb-remote protocol (AugmentRegisterInfoViaABI)
Both of these uses need the DWARF an EH register numbers, which is
information that is already available in LLVM. This patch makes it
possible to do so.
It adds a GetMCRegisterInfo method to the ABI class, which every class
is expected to implement. Normally, it should be sufficient to obtain
the definitions from the appropriate llvm::Target object (for which I
provide a utility function), but the subclasses are free to construct it
in any way they deem fit.
We should be able to always get the MCRegisterInfo object from llvm,
with one important exception: if the relevant llvm target was disabled
at compile time. To handle this, I add a mechanism to disable the
compilation of ABI plugins based on the value of LLVM_TARGETS_TO_BUILD
cmake setting. This ensures all our existing are able to create their
MCRegisterInfo objects.
The new MCRegisterInfo api is not used yet, but the intention is to make
use of it in follow-up patches.
Reviewers: jasonmolenda, aprantl, JDevlieghere, tatyana-krasnukha
Subscribers: wuzish, nemanjai, mgorny, kbarton, atanasyan, lldb-commits
Differential Revision: https://reviews.llvm.org/D67965
llvm-svn: 372862
Diffstat (limited to 'lldb/source/Plugins/ABI/SysV-hexagon')
| -rw-r--r-- | lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index ae836851162..34d9258ccb9 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -1014,7 +1014,8 @@ size_t ABISysV_hexagon::GetRedZoneSize() const { return 0; } ABISP ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { if (arch.GetTriple().getArch() == llvm::Triple::hexagon) { - return ABISP(new ABISysV_hexagon(process_sp)); + return ABISP( + new ABISysV_hexagon(std::move(process_sp), MakeMCRegisterInfo(arch))); } return ABISP(); } diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h index 459b6315dba..bef64a22d95 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h @@ -97,7 +97,9 @@ protected: bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info); private: - ABISysV_hexagon(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) { + ABISysV_hexagon(lldb::ProcessSP process_sp, + std::unique_ptr<llvm::MCRegisterInfo> info_up) + : lldb_private::ABI(std::move(process_sp), std::move(info_up)) { // Call CreateInstance instead. } }; |

