22 using StatementList = std::list<std::unique_ptr<Statement>>;
46 symbol_ = std::move(
symbol);
54 return std::move(section_);
118 return *std::prev(
end());
122 return *std::prev(
end());
126 return stmts_.empty();
130 return stmts_.size();
136 return add(
begin(), std::move(stmt));
140 return add(
end(), std::move(stmt));
159 std::string section_;
162 StatementList stmts_;
167template <
typename GlobalValueT>
168 requires std::derived_from<GlobalValueT, mini_llvm::mc::GlobalValue>
169struct std::formatter<GlobalValueT> {
170 constexpr auto parse(std::format_parse_context &ctx) {
174 template <
typename FormatContext>
175 auto format(
const GlobalValueT &G, FormatContext &ctx)
const {
176 return std::format_to(ctx.out(),
"{}", G.format());
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
Definition IndirectIterator.h:16
GlobalValue(Symbol symbol, std::string section, bool isGlobal)
Definition GlobalValue.h:33
IndirectIterator< StatementList::reverse_iterator, Statement > reverse_iterator
Definition GlobalValue.h:27
int alignment() const
Definition GlobalValue.h:69
void setSymbol(Symbol symbol)
Definition GlobalValue.h:45
std::string && section() &&
Definition GlobalValue.h:53
Statement & add(const_iterator pos, std::unique_ptr< Statement > stmt)
reverse_iterator rbegin()
Definition GlobalValue.h:93
GlobalValue(GlobalValue &&)=default
const Statement & front() const
Definition GlobalValue.h:113
void removeFirst()
Definition GlobalValue.h:145
Statement & prepend(std::unique_ptr< Statement > stmt)
Definition GlobalValue.h:135
const_reverse_iterator rend() const
Definition GlobalValue.h:105
void setGlobal(bool isGlobal)
Definition GlobalValue.h:65
const Statement & back() const
Definition GlobalValue.h:121
reverse_iterator rend()
Definition GlobalValue.h:101
IndirectIterator< StatementList::iterator, Statement > iterator
Definition GlobalValue.h:25
const_reverse_iterator rbegin() const
Definition GlobalValue.h:97
Statement & back()
Definition GlobalValue.h:117
const_iterator begin() const
Definition GlobalValue.h:81
void removeLast()
Definition GlobalValue.h:149
Statement & front()
Definition GlobalValue.h:109
size_t size() const
Definition GlobalValue.h:129
void setSection(std::string section)
Definition GlobalValue.h:57
GlobalValue & operator=(GlobalValue &&)=default
GlobalValue(const GlobalValue &)=delete
std::string format() const
iterator end()
Definition GlobalValue.h:85
void remove(const_iterator pos)
const std::string & section() const &
Definition GlobalValue.h:49
bool empty() const
Definition GlobalValue.h:125
IndirectIterator< StatementList::const_reverse_iterator, const Statement > const_reverse_iterator
Definition GlobalValue.h:28
GlobalValue & operator=(const GlobalValue &)=delete
iterator begin()
Definition GlobalValue.h:77
IndirectIterator< StatementList::const_iterator, const Statement > const_iterator
Definition GlobalValue.h:26
const Symbol & symbol() const
Definition GlobalValue.h:41
void setAlignment(int alignment)
Definition GlobalValue.h:73
GlobalValue(Symbol symbol, std::string section, bool isGlobal, int alignment)
Definition GlobalValue.h:30
const_iterator end() const
Definition GlobalValue.h:89
Statement & append(std::unique_ptr< Statement > stmt)
Definition GlobalValue.h:139
bool isGlobal() const
Definition GlobalValue.h:61
Definition Statement.h:13