Remove now-unnecessary cleanup functions

This commit is contained in:
Rangi42
2024-02-28 20:59:00 -05:00
committed by Sylvie
parent 96f354026a
commit 17df94c75b
5 changed files with 2 additions and 27 deletions

View File

@@ -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
*/

View File

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

View File

@@ -550,8 +550,5 @@ static void freeSection(struct Section *section)
void obj_Cleanup(void)
{
sym_CleanupSymbols();
sect_ForEach(freeSection);
sect_CleanupSections();
}

View File

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

View File

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