mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
RISCVRegisterOperand.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <string>
6
7
#include "
mini-llvm/mc/Operand.h
"
8
#include "
mini-llvm/targets/riscv/mc/RISCVRegister.h
"
9
10
namespace
mini_llvm::mc
{
11
12
class
RISCVRegisterOperand
final :
public
Operand
{
13
public
:
14
explicit
RISCVRegisterOperand
(
int
idx
) : idx_(
idx
) {}
15
16
int
idx
()
const
{
17
return
idx_;
18
}
19
20
void
setIdx
(
int
idx
) {
21
idx_ =
idx
;
22
}
23
24
std::string
format
()
const override
{
25
return
name
(
static_cast<
RISCVRegister
>
(
idx
()));
26
}
27
28
private
:
29
int
idx_;
30
};
31
32
}
// namespace mini_llvm::mc
Operand.h
mini_llvm::mc::Operand::Operand
Operand()=default
mini_llvm::mc::RISCVRegisterOperand::format
std::string format() const override
Definition
RISCVRegisterOperand.h:24
mini_llvm::mc::RISCVRegisterOperand::idx
int idx() const
Definition
RISCVRegisterOperand.h:16
mini_llvm::mc::RISCVRegisterOperand::setIdx
void setIdx(int idx)
Definition
RISCVRegisterOperand.h:20
mini_llvm::mc::RISCVRegisterOperand::RISCVRegisterOperand
RISCVRegisterOperand(int idx)
Definition
RISCVRegisterOperand.h:14
RISCVRegister.h
mini_llvm::mc
Definition
Directive.h:8
mini_llvm::mc::RISCVRegister
RISCVRegister
Definition
RISCVRegister.h:9
mini_llvm::mc::name
constexpr const char * name(RISCVRegister reg)
Definition
RISCVRegister.h:17
include
mini-llvm
targets
riscv
mc
RISCVRegisterOperand.h
Generated by
1.17.0