Use std::unordered_map for symbols

This commit is contained in:
Rangi42
2024-03-16 11:19:19 -04:00
parent a14de10e28
commit cefc4f4aa3
2 changed files with 4 additions and 4 deletions

View File

@@ -6,9 +6,9 @@
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <map>
#include <new>
#include <stdio.h>
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
@@ -22,7 +22,7 @@
#include "asm/output.hpp"
#include "asm/warning.hpp"
std::map<std::string, Symbol> symbols;
std::unordered_map<std::string, Symbol> symbols;
static std::optional<std::string> labelScope = std::nullopt; // Current section's label scope
static Symbol *PCSymbol;

View File

@@ -3,8 +3,8 @@
#include "link/symbol.hpp"
#include <inttypes.h>
#include <map>
#include <stdlib.h>
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
@@ -13,7 +13,7 @@
#include "link/object.hpp"
#include "link/section.hpp"
std::map<std::string, Symbol *> symbols;
std::unordered_map<std::string, Symbol *> symbols;
Label &Symbol::label() {
assert(std::holds_alternative<Label>(data));