Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / Utility / RegisterContextPOSIX_loongarch64.cpp
bloba48a58f28f7aadf4733352dc77a9dabfa1045fd5
1 //===-- RegisterContextPOSIX_loongarch64.cpp --------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Target/Process.h"
10 #include "lldb/Target/Target.h"
11 #include "lldb/Target/Thread.h"
12 #include "lldb/Utility/DataBufferHeap.h"
13 #include "lldb/Utility/DataExtractor.h"
14 #include "lldb/Utility/Endian.h"
15 #include "lldb/Utility/RegisterValue.h"
16 #include "lldb/Utility/Scalar.h"
17 #include "llvm/Support/Compiler.h"
19 #include "RegisterContextPOSIX_loongarch64.h"
21 using namespace lldb;
22 using namespace lldb_private;
24 RegisterContextPOSIX_loongarch64::RegisterContextPOSIX_loongarch64(
25 lldb_private::Thread &thread,
26 std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info)
27 : lldb_private::RegisterContext(thread, 0),
28 m_register_info_up(std::move(register_info)) {}
30 RegisterContextPOSIX_loongarch64::~RegisterContextPOSIX_loongarch64() = default;
32 void RegisterContextPOSIX_loongarch64::invalidate() {}
34 void RegisterContextPOSIX_loongarch64::InvalidateAllRegisters() {}
36 size_t RegisterContextPOSIX_loongarch64::GetRegisterCount() {
37 return m_register_info_up->GetRegisterCount();
40 size_t RegisterContextPOSIX_loongarch64::GetGPRSize() {
41 return m_register_info_up->GetGPRSize();
44 unsigned RegisterContextPOSIX_loongarch64::GetRegisterSize(unsigned int reg) {
45 return m_register_info_up->GetRegisterInfo()[reg].byte_size;
48 unsigned RegisterContextPOSIX_loongarch64::GetRegisterOffset(unsigned int reg) {
49 return m_register_info_up->GetRegisterInfo()[reg].byte_offset;
52 const lldb_private::RegisterInfo *
53 RegisterContextPOSIX_loongarch64::GetRegisterInfoAtIndex(size_t reg) {
54 if (reg < GetRegisterCount())
55 return &GetRegisterInfo()[reg];
57 return nullptr;
60 size_t RegisterContextPOSIX_loongarch64::GetRegisterSetCount() {
61 return m_register_info_up->GetRegisterCount();
64 const lldb_private::RegisterSet *
65 RegisterContextPOSIX_loongarch64::GetRegisterSet(size_t set) {
66 return m_register_info_up->GetRegisterSet(set);
69 const lldb_private::RegisterInfo *
70 RegisterContextPOSIX_loongarch64::GetRegisterInfo() {
71 return m_register_info_up->GetRegisterInfo();
74 bool RegisterContextPOSIX_loongarch64::IsGPR(unsigned int reg) {
75 return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
76 RegisterInfoPOSIX_loongarch64::GPRegSet;
79 bool RegisterContextPOSIX_loongarch64::IsFPR(unsigned int reg) {
80 return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
81 RegisterInfoPOSIX_loongarch64::FPRegSet;