diff --git a/stage0/sema.c b/stage0/sema.c index f591a28bb7..6de3160a2d 100644 --- a/stage0/sema.c +++ b/stage0/sema.c @@ -17,16 +17,6 @@ } \ } while (0) -// Simple djb2 hash for enum literal names. -static uint32_t simpleStringHash(const char* s) { - uint32_t h = 5381; - while (*s) { - h = h * 33 + (uint8_t)*s; - s++; - } - return h; -} - #define SEMA_AIR_INITIAL_CAP 256 #define SEMA_AIR_EXTRA_INITIAL_CAP 256 #define INST_MAP_INITIAL_CAP 32 @@ -9976,7 +9966,7 @@ static AirInstRef zirEnumLiteral(Sema* sema, uint32_t inst) { InternPoolKey key; memset(&key, 0, sizeof(key)); key.tag = IP_KEY_ENUM_LITERAL; - key.data.enum_literal = simpleStringHash(name); + key.data.enum_literal = ipGetOrPutString(sema->ip, name); return AIR_REF_FROM_IP(ipIntern(sema->ip, key)); }