mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Run clang-format on everything (#1332)
This commit is contained in:
@@ -1,35 +1,33 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include "link/symbol.hpp"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <map>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
#include "link/object.hpp"
|
||||
#include "link/section.hpp"
|
||||
#include "link/symbol.hpp"
|
||||
#include "link/main.hpp"
|
||||
|
||||
#include "error.hpp"
|
||||
#include "helpers.hpp"
|
||||
|
||||
#include "link/main.hpp"
|
||||
#include "link/object.hpp"
|
||||
#include "link/section.hpp"
|
||||
|
||||
std::map<std::string, Symbol *> symbols;
|
||||
|
||||
Label &Symbol::label()
|
||||
{
|
||||
Label &Symbol::label() {
|
||||
assert(std::holds_alternative<Label>(data));
|
||||
return std::get<Label>(data);
|
||||
}
|
||||
|
||||
Label const &Symbol::label() const
|
||||
{
|
||||
Label const &Symbol::label() const {
|
||||
assert(std::holds_alternative<Label>(data));
|
||||
return std::get<Label>(data);
|
||||
}
|
||||
|
||||
void sym_AddSymbol(Symbol &symbol)
|
||||
{
|
||||
void sym_AddSymbol(Symbol &symbol) {
|
||||
// Check if the symbol already exists
|
||||
if (Symbol *other = sym_GetSymbol(symbol.name); other) {
|
||||
fprintf(stderr, "error: \"%s\" both in %s from ", symbol.name.c_str(), symbol.objFileName);
|
||||
@@ -44,8 +42,7 @@ void sym_AddSymbol(Symbol &symbol)
|
||||
symbols[symbol.name] = &symbol;
|
||||
}
|
||||
|
||||
Symbol *sym_GetSymbol(std::string const &name)
|
||||
{
|
||||
Symbol *sym_GetSymbol(std::string const &name) {
|
||||
auto search = symbols.find(name);
|
||||
return search != symbols.end() ? search->second : nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user