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