mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
IntegerImmediate.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <cstdint>
6
#include <memory>
7
8
#include "
mini-llvm/mir/Immediate.h
"
9
10
namespace
mini_llvm::mir
{
11
12
class
IntegerImmediate
final :
public
Immediate
{
13
public
:
14
explicit
IntegerImmediate
(int64_t
value
) : value_(
value
) {}
15
16
int64_t
value
()
const override
{
17
return
value_;
18
}
19
20
std::unique_ptr<Immediate>
clone
()
const override
{
21
return
std::make_unique<IntegerImmediate>(
value
());
22
}
23
24
private
:
25
int64_t value_;
26
};
27
28
}
// namespace mini_llvm::mir
Immediate.h
mini_llvm::mir::Immediate::Immediate
Immediate(const Immediate &)=delete
mini_llvm::mir::IntegerImmediate::clone
std::unique_ptr< Immediate > clone() const override
Definition
IntegerImmediate.h:20
mini_llvm::mir::IntegerImmediate::value
int64_t value() const override
Definition
IntegerImmediate.h:16
mini_llvm::mir::IntegerImmediate::IntegerImmediate
IntegerImmediate(int64_t value)
Definition
IntegerImmediate.h:14
mini_llvm::mir
Definition
BasicBlock.h:22
include
mini-llvm
mir
IntegerImmediate.h
Generated by
1.17.0