Run clang-format on everything (#1332)

This commit is contained in:
Sylvie
2024-03-04 14:22:49 -05:00
committed by GitHub
parent b004648a13
commit e74073e480
66 changed files with 6091 additions and 4957 deletions

View File

@@ -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;
}