mini-llvm 0.1.0
Loading...
Searching...
No Matches
RISCVImmediateOperand.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
9
10namespace mini_llvm::mc {
11
12class RISCVImmediateOperand final : public Operand {
13public:
14 explicit RISCVImmediateOperand(int64_t value) : value_(value) {}
15
16 int64_t value() const {
17 return value_;
18 }
19
20 void setValue(int64_t value) {
21 value_ = value;
22 }
23
24 std::string format() const override {
25 return std::to_string(value());
26 }
27
28private:
29 int64_t value_;
30};
31
32} // namespace mini_llvm::mc
void setValue(int64_t value)
Definition RISCVImmediateOperand.h:20
RISCVImmediateOperand(int64_t value)
Definition RISCVImmediateOperand.h:14
std::string format() const override
Definition RISCVImmediateOperand.h:24
int64_t value() const
Definition RISCVImmediateOperand.h:16
Definition Directive.h:8