From 17df94c75b2e740d03328bbed9049b003362b8d5 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Wed, 28 Feb 2024 20:59:00 -0500 Subject: [PATCH] Remove now-unnecessary cleanup functions --- include/link/section.hpp | 5 ----- include/link/symbol.hpp | 5 ----- src/link/object.cpp | 3 --- src/link/section.cpp | 5 ----- src/link/symbol.cpp | 11 ++--------- 5 files changed, 2 insertions(+), 27 deletions(-) diff --git a/include/link/section.hpp b/include/link/section.hpp index c354c930..b2a5f314 100644 --- a/include/link/section.hpp +++ b/include/link/section.hpp @@ -72,11 +72,6 @@ void sect_AddSection(struct Section *section); */ struct Section *sect_GetSection(std::string const &name); -/* - * `free`s all section memory that was allocated. - */ -void sect_CleanupSections(void); - /* * Checks if all sections meet reasonable criteria, such as max size */ diff --git a/include/link/symbol.hpp b/include/link/symbol.hpp index 34759c4f..94bb1260 100644 --- a/include/link/symbol.hpp +++ b/include/link/symbol.hpp @@ -39,9 +39,4 @@ void sym_AddSymbol(struct Symbol *symbol); */ struct Symbol *sym_GetSymbol(std::string const &name); -/* - * `free`s all symbol memory that was allocated. - */ -void sym_CleanupSymbols(void); - #endif // RGBDS_LINK_SYMBOL_H diff --git a/src/link/object.cpp b/src/link/object.cpp index aec2e737..78d093d6 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -550,8 +550,5 @@ static void freeSection(struct Section *section) void obj_Cleanup(void) { - sym_CleanupSymbols(); - sect_ForEach(freeSection); - sect_CleanupSections(); } diff --git a/src/link/section.cpp b/src/link/section.cpp index 8a7333cc..d041cc99 100644 --- a/src/link/section.cpp +++ b/src/link/section.cpp @@ -185,11 +185,6 @@ struct Section *sect_GetSection(std::string const &name) return search != sections.end() ? search->second : NULL; } -void sect_CleanupSections(void) -{ - sections.clear(); -} - static void doSanityChecks(struct Section *section) { // Sanity check the section's type diff --git a/src/link/symbol.cpp b/src/link/symbol.cpp index 0531ac54..d6015075 100644 --- a/src/link/symbol.cpp +++ b/src/link/symbol.cpp @@ -17,11 +17,9 @@ void sym_AddSymbol(struct Symbol *symbol) { // Check if the symbol already exists if (struct Symbol *other = sym_GetSymbol(symbol->name); other) { - fprintf(stderr, "error: \"%s\" both in %s from ", symbol->name.c_str(), - symbol->objFileName); + fprintf(stderr, "error: \"%s\" both in %s from ", symbol->name.c_str(), symbol->objFileName); dumpFileStack(symbol->src); - fprintf(stderr, "(%" PRIu32 ") and in %s from ", - symbol->lineNo, other->objFileName); + fprintf(stderr, "(%" PRIu32 ") and in %s from ", symbol->lineNo, other->objFileName); dumpFileStack(other->src); fprintf(stderr, "(%" PRIu32 ")\n", other->lineNo); exit(1); @@ -36,8 +34,3 @@ struct Symbol *sym_GetSymbol(std::string const &name) auto search = symbols.find(name); return search != symbols.end() ? search->second : NULL; } - -void sym_CleanupSymbols(void) -{ - symbols.clear(); -}