LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
asm
riscv
operands
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
18
#include "
LIEF/asm/riscv/Operand.hpp
"
19
#include "
LIEF/asm/riscv/registers.hpp
"
20
21
22
namespace
LIEF::assembly::riscv::operands
{
23
37
class
LIEF_API
Register
:
public
Operand {
38
public
:
39
using
Operand::Operand;
40
41
struct
reg_t
{
43
enum class
TYPE
{
44
NONE = 0,
46
SYSREG
,
48
REG
,
49
};
50
51
union
{
52
REG
reg
=
REG::NoRegister
;
53
SYSREG
sysreg
;
54
};
55
TYPE
type
=
TYPE::NONE
;
56
};
57
59
reg_t
value
()
const
;
60
61
static
bool
classof
(
const
Operand* op);
62
~Register
()
override
=
default
;
63
};
64
}
65
66
67
#endif
LIEF::assembly::riscv::operands::Register
This class represents a register operand.
Definition
riscv/operands/Register.hpp:37
LIEF::assembly::riscv::operands::Register::~Register
~Register() override=default
LIEF::assembly::riscv::operands::Register::value
reg_t value() const
The effective register as either: a REG or a SYSREG.
LIEF::assembly::riscv::operands::Register::classof
static bool classof(const Operand *op)
LIEF::assembly::riscv::operands
Namespace that wraps the different RISC-V operands.
Definition
riscv/operands/Immediate.hpp:21
LIEF::assembly::riscv::REG
REG
Definition
riscv/registers.hpp:25
LIEF::assembly::riscv::REG::NoRegister
@ NoRegister
Definition
riscv/registers.hpp:26
LIEF::assembly::riscv::SYSREG
SYSREG
Definition
riscv/registers.hpp:602
Operand.hpp
registers.hpp
LIEF::assembly::riscv::operands::Register::reg_t
Definition
riscv/operands/Register.hpp:41
LIEF::assembly::riscv::operands::Register::reg_t::TYPE
TYPE
Enum type used to discriminate the anonymous union.
Definition
riscv/operands/Register.hpp:43
LIEF::assembly::riscv::operands::Register::reg_t::TYPE::NONE
@ NONE
Definition
riscv/operands/Register.hpp:44
LIEF::assembly::riscv::operands::Register::reg_t::reg
REG reg
Definition
riscv/operands/Register.hpp:52
LIEF::assembly::riscv::operands::Register::reg_t::sysreg
SYSREG sysreg
Definition
riscv/operands/Register.hpp:53
LIEF::assembly::riscv::operands::Register::reg_t::type
TYPE type
Definition
riscv/operands/Register.hpp:55
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0