Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / Utility / RegisterContextPOSIX_loongarch64.h
blob95f93bb41f015dddd8fc85c7bbd08c80ba2ffc6a
1 //===-- RegisterContextPOSIX_loongarch64.h ----------------------*- 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 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
12 #include "RegisterInfoInterface.h"
13 #include "RegisterInfoPOSIX_loongarch64.h"
14 #include "lldb-loongarch-register-enums.h"
15 #include "lldb/Target/RegisterContext.h"
16 #include "lldb/Utility/Log.h"
18 class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {
19 public:
20 RegisterContextPOSIX_loongarch64(
21 lldb_private::Thread &thread,
22 std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info);
24 ~RegisterContextPOSIX_loongarch64() override;
26 void invalidate();
28 void InvalidateAllRegisters() override;
30 size_t GetRegisterCount() override;
32 virtual size_t GetGPRSize();
34 virtual unsigned GetRegisterSize(unsigned reg);
36 virtual unsigned GetRegisterOffset(unsigned reg);
38 const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
40 size_t GetRegisterSetCount() override;
42 const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
44 protected:
45 std::unique_ptr<RegisterInfoPOSIX_loongarch64> m_register_info_up;
47 virtual const lldb_private::RegisterInfo *GetRegisterInfo();
49 bool IsGPR(unsigned reg);
51 bool IsFPR(unsigned reg);
53 size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_loongarch64::FPR); }
55 uint32_t GetRegNumFCSR() const { return fpr_fcsr_loongarch; }
57 virtual bool ReadGPR() = 0;
58 virtual bool ReadFPR() = 0;
59 virtual bool WriteGPR() = 0;
60 virtual bool WriteFPR() = 0;
63 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H