mini-llvm 0.1.0
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
10#include "mini-llvm/mc/Symbol.h"
11
12namespace mini_llvm::mc {
13
14class Label final : public Statement {
15public:
16 explicit Label(Symbol symbol) : symbol_(std::move(symbol)) {}
17
18 const Symbol &symbol() const {
19 return symbol_;
20 }
21
23 symbol_ = std::move(symbol);
24 }
25
26 std::string format() const override {
27 return std::format("{}:", symbol());
28 }
29
30private:
31 Symbol symbol_;
32};
33
34} // namespace mini_llvm::mc
void setSymbol(Symbol symbol)
Definition Label.h:22
const Symbol & symbol() const
Definition Label.h:18
std::string format() const override
Definition Label.h:26
Label(Symbol symbol)
Definition Label.h:16
Definition Symbol.h:16
Definition Directive.h:8