Intern strings used as identifiers (for labels, constants, macros, charmaps, etc) (#1980)

This commit is contained in:
Rangi
2026-05-25 16:22:29 -04:00
committed by GitHub
parent ed19806434
commit cfa0adf295
22 changed files with 341 additions and 218 deletions
+2 -2
View File
@@ -1158,7 +1158,7 @@ void sect_EndSection() {
sym_ResetCurrentLabelScopes();
}
std::string sect_PushSectionFragmentLiteral() {
InternedStr sect_PushSectionFragmentLiteral() {
static uint64_t nextFragmentLiteralID = 0;
// Like `requireCodeSection` but fatal
@@ -1192,5 +1192,5 @@ std::string sect_PushSectionFragmentLiteral() {
currentSection = sect;
// Return a symbol ID to use for the address of this section fragment
return "$"s + std::to_string(nextFragmentLiteralID++);
return intern("$"s + std::to_string(nextFragmentLiteralID++));
}