mini-llvm 0.1.0
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
11
12namespace mini_llvm::mc {
13
14class RISCVAddressOperand final : public Operand {
15public:
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
30 return std::move(addr_);
31 }
32
33 std::string format() const override {
34 return addr().format();
35 }
36
37private:
38 RISCVAddress addr_;
39};
40
41} // namespace mini_llvm::mc
RISCVAddressOperand(Symbol baseSymbol, int64_t offset)
Definition RISCVAddressOperand.h:22
RISCVAddress && addr() &&
Definition RISCVAddressOperand.h:29
RISCVAddressOperand(RISCVAddress addr)
Definition RISCVAddressOperand.h:16
RISCVAddressOperand(Symbol baseSymbol)
Definition RISCVAddressOperand.h:19
const RISCVAddress & addr() const &
Definition RISCVAddressOperand.h:25
std::string format() const override
Definition RISCVAddressOperand.h:33
Definition RISCVAddress.h:18
std::string format() const
Definition Symbol.h:16
Definition Directive.h:8