LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
riscv/operands/Register.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_ASM_RISCV_OPERAND_REG_H
16#define LIEF_ASM_RISCV_OPERAND_REG_H
17
20
21namespace LIEF {
22namespace assembly {
23namespace riscv {
24namespace operands {
25
39class LIEF_API Register : public Operand {
40 public:
41 using Operand::Operand;
42
43 struct reg_t {
45 enum class TYPE {
46 NONE = 0,
51 };
52
53 union {
56 };
58 };
59
61 reg_t value() const;
62
63 static bool classof(const Operand* op);
64 ~Register() override = default;
65};
66}
67}
68}
69}
70#endif
This class represents a register operand.
Definition riscv/operands/Register.hpp:39
reg_t value() const
The effective register as either: a REG or a SYSREG.
static bool classof(const Operand *op)
Namespace that wraps the different RISC-V operands.
Definition riscv/operands/Immediate.hpp:23
RISC-V architecture-related namespace.
Definition riscv/Instruction.hpp:27
REG
Definition riscv/registers.hpp:25
@ NoRegister
Definition riscv/registers.hpp:26
SYSREG
Definition riscv/registers.hpp:602
Namespace related to assembly/disassembly support.
Definition Abstract/Binary.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:41
Definition riscv/operands/Register.hpp:43
TYPE
Enum type used to discriminate the anonymous union.
Definition riscv/operands/Register.hpp:45
@ NONE
Definition riscv/operands/Register.hpp:46
REG reg
Definition riscv/operands/Register.hpp:54
SYSREG sysreg
Definition riscv/operands/Register.hpp:55
TYPE type
Definition riscv/operands/Register.hpp:57
#define LIEF_API
Definition visibility.h:45