mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
VirtualRegister.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <string>
6
#include <utility>
7
8
#include "
mini-llvm/mir/Register.h
"
9
#include "
mini-llvm/utils/Compiler.h
"
10
11
namespace
mini_llvm::mir
{
12
13
class
MINI_LLVM_EXPORT
VirtualRegister
final :
public
Register
{
14
public
:
15
explicit
VirtualRegister
(
int
width
)
16
: width_(
width
) {}
17
18
const
std::string &
name
() const & {
19
return
name_;
20
}
21
22
std::string &&
name
() && {
23
return
std::move(name_);
24
}
25
26
void
setName
(std::string
name
) {
27
name_ = std::move(
name
);
28
}
29
30
int
width
()
const override
{
31
return
width_;
32
}
33
34
std::string
format
()
const override
;
35
36
private
:
37
std::string name_;
38
int
width_;
39
};
40
41
}
// namespace mini_llvm::mir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Register.h
mini_llvm::mir::Register::Register
Register()=default
mini_llvm::mir::VirtualRegister::setName
void setName(std::string name)
Definition
VirtualRegister.h:26
mini_llvm::mir::VirtualRegister::name
std::string && name() &&
Definition
VirtualRegister.h:22
mini_llvm::mir::VirtualRegister::name
const std::string & name() const &
Definition
VirtualRegister.h:18
mini_llvm::mir::VirtualRegister::VirtualRegister
VirtualRegister(int width)
Definition
VirtualRegister.h:15
mini_llvm::mir::VirtualRegister::width
int width() const override
Definition
VirtualRegister.h:30
mini_llvm::mir::VirtualRegister::format
std::string format() const override
mini_llvm::mir
Definition
BasicBlock.h:22
include
mini-llvm
mir
VirtualRegister.h
Generated by
1.17.0