mini-llvm 0.1.0
Loading...
Searching...
No Matches
GlobalValueBuilder.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <memory>
6#include <utility>
7
10
11namespace mini_llvm::mc {
12
14public:
15 GlobalValueBuilder() = default;
16
18 : globalValue_(globalValue), pos_(pos) {}
19
21 globalValue_ = globalValue;
22 pos_ = pos;
23 }
24
26 setPos(G, G->end());
27 }
28
29 Statement &add(std::unique_ptr<Statement> stmt) {
30 return globalValue_->add(pos_, std::move(stmt));
31 }
32
33private:
34 GlobalValue *globalValue_{};
36};
37
38} // namespace mini_llvm::mc
void setPos(GlobalValue *globalValue, GlobalValue::const_iterator pos)
Definition GlobalValueBuilder.h:20
GlobalValueBuilder(GlobalValue *globalValue, GlobalValue::const_iterator pos)
Definition GlobalValueBuilder.h:17
Statement & add(std::unique_ptr< Statement > stmt)
Definition GlobalValueBuilder.h:29
void setPos(GlobalValue *G)
Definition GlobalValueBuilder.h:25
Definition GlobalValue.h:21
iterator end()
Definition GlobalValue.h:85
IndirectIterator< StatementList::const_iterator, const Statement > const_iterator
Definition GlobalValue.h:26
Definition Statement.h:13
Definition Directive.h:8