From 64c7e4eeb39eaba79a25e586d5507fcb92cc6105 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 18 Jul 2025 18:00:33 -0400 Subject: [PATCH] Add a comment on EntityName's CarbonHashtableEq about its requirements (#5828) The entity name structure will grow at least one more field for symbolic bindings (see [open discussion](https://docs.google.com/document/d/1Yt-i5AmF76LSvD4TrWRIAE_92kii6j5yFiW-S7ahzlg/edit?tab=t.0)), so we can just refer to the "following" fields to include them all. --- toolchain/sem_ir/entity_name.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchain/sem_ir/entity_name.h b/toolchain/sem_ir/entity_name.h index bd75b99cc3b3..63239a80214c 100644 --- a/toolchain/sem_ir/entity_name.h +++ b/toolchain/sem_ir/entity_name.h @@ -21,6 +21,9 @@ struct EntityName : public Printable { friend auto CarbonHashtableEq(const EntityName& lhs, const EntityName& rhs) -> bool { + // This requires that there are no padding bits in the type. This is upheld + // since it holds values all of the same size: each is 32 bits, with one + // split into 31 and 1 bits. return std::memcmp(&lhs, &rhs, sizeof(EntityName)) == 0; }