mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
RISCVAddressOperand.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <cstdint>
6
#include <string>
7
#include <utility>
8
9
#include "
mini-llvm/mc/Operand.h
"
10
#include "
mini-llvm/targets/riscv/mc/RISCVAddress.h
"
11
12
namespace
mini_llvm::mc
{
13
14
class
RISCVAddressOperand
final :
public
Operand
{
15
public
:
16
explicit
RISCVAddressOperand
(
RISCVAddress
addr
)
17
: addr_(std::move(
addr
)) {}
18
19
explicit
RISCVAddressOperand
(
Symbol
baseSymbol)
20
: addr_(std::move(baseSymbol)) {}
21
22
RISCVAddressOperand
(
Symbol
baseSymbol, int64_t offset)
23
: addr_(std::move(baseSymbol), offset) {}
24
25
const
RISCVAddress
&
addr
() const & {
26
return
addr_;
27
}
28
29
RISCVAddress
&&
addr
() && {
30
return
std::move(addr_);
31
}
32
33
std::string
format
()
const override
{
34
return
addr
().
format
();
35
}
36
37
private
:
38
RISCVAddress
addr_;
39
};
40
41
}
// namespace mini_llvm::mc
Operand.h
RISCVAddress.h
mini_llvm::mc::Operand::Operand
Operand()=default
mini_llvm::mc::RISCVAddressOperand::RISCVAddressOperand
RISCVAddressOperand(Symbol baseSymbol, int64_t offset)
Definition
RISCVAddressOperand.h:22
mini_llvm::mc::RISCVAddressOperand::addr
RISCVAddress && addr() &&
Definition
RISCVAddressOperand.h:29
mini_llvm::mc::RISCVAddressOperand::RISCVAddressOperand
RISCVAddressOperand(RISCVAddress addr)
Definition
RISCVAddressOperand.h:16
mini_llvm::mc::RISCVAddressOperand::RISCVAddressOperand
RISCVAddressOperand(Symbol baseSymbol)
Definition
RISCVAddressOperand.h:19
mini_llvm::mc::RISCVAddressOperand::addr
const RISCVAddress & addr() const &
Definition
RISCVAddressOperand.h:25
mini_llvm::mc::RISCVAddressOperand::format
std::string format() const override
Definition
RISCVAddressOperand.h:33
mini_llvm::mc::RISCVAddress
Definition
RISCVAddress.h:18
mini_llvm::mc::RISCVAddress::format
std::string format() const
mini_llvm::mc::Symbol
Definition
Symbol.h:16
mini_llvm::mc
Definition
Directive.h:8
include
mini-llvm
targets
riscv
mc
RISCVAddressOperand.h
Generated by
1.17.0