mini-llvm
0.1.0
Toggle main menu visibility
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
8
#include "
mini-llvm/mc/GlobalValue.h
"
9
#include "
mini-llvm/mc/Statement.h
"
10
11
namespace
mini_llvm::mc
{
12
13
class
GlobalValueBuilder
{
14
public
:
15
GlobalValueBuilder
() =
default
;
16
17
GlobalValueBuilder
(
GlobalValue
*globalValue,
GlobalValue::const_iterator
pos)
18
: globalValue_(globalValue), pos_(pos) {}
19
20
void
setPos
(
GlobalValue
*globalValue,
GlobalValue::const_iterator
pos) {
21
globalValue_ = globalValue;
22
pos_ = pos;
23
}
24
25
void
setPos
(
GlobalValue
*G) {
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
33
private
:
34
GlobalValue
*globalValue_{};
35
GlobalValue::const_iterator
pos_{};
36
};
37
38
}
// namespace mini_llvm::mc
Statement.h
mini_llvm::mc::GlobalValueBuilder::setPos
void setPos(GlobalValue *globalValue, GlobalValue::const_iterator pos)
Definition
GlobalValueBuilder.h:20
mini_llvm::mc::GlobalValueBuilder::GlobalValueBuilder
GlobalValueBuilder(GlobalValue *globalValue, GlobalValue::const_iterator pos)
Definition
GlobalValueBuilder.h:17
mini_llvm::mc::GlobalValueBuilder::add
Statement & add(std::unique_ptr< Statement > stmt)
Definition
GlobalValueBuilder.h:29
mini_llvm::mc::GlobalValueBuilder::setPos
void setPos(GlobalValue *G)
Definition
GlobalValueBuilder.h:25
mini_llvm::mc::GlobalValueBuilder::GlobalValueBuilder
GlobalValueBuilder()=default
mini_llvm::mc::GlobalValue
Definition
GlobalValue.h:21
mini_llvm::mc::GlobalValue::end
iterator end()
Definition
GlobalValue.h:85
mini_llvm::mc::GlobalValue::const_iterator
IndirectIterator< StatementList::const_iterator, const Statement > const_iterator
Definition
GlobalValue.h:26
mini_llvm::mc::Statement
Definition
Statement.h:13
GlobalValue.h
mini_llvm::mc
Definition
Directive.h:8
include
mini-llvm
mc
GlobalValueBuilder.h
Generated by
1.17.0