aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-09-24 19:42:06 -0700
committerGitHub <noreply@github.com>2023-09-24 19:42:06 -0700
commiteb072fa52846c6583b856c8c88d50d65f46b3667 (patch)
treef1c1f213685f476200562bcc870bc774bd81fa2f /src/Module.zig
parentdf5f0517b33b5f7bc2a508cf6a0ee62246f02d21 (diff)
parentc08c0fc6eddf601785abfbc5e5a9ab5c89d7cfbf (diff)
downloadzig-eb072fa52846c6583b856c8c88d50d65f46b3667.tar.gz
zig-eb072fa52846c6583b856c8c88d50d65f46b3667.zip
Merge pull request #17256 from ziglang/packed-bit-offsets
compiler: packed structs cache bit offsets
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 17a97e6c6d..bdf8d3a768 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -6650,10 +6650,10 @@ pub fn structFieldAlignmentExtern(mod: *Module, field_ty: Type) Alignment {
return ty_abi_align;
}
-/// TODO: avoid linear search by storing these in trailing data of packed struct types
-/// then packedStructFieldByteOffset can be expressed in terms of bits / 8, fixing
-/// that one too.
-/// https://github.com/ziglang/zig/issues/17178
+/// https://github.com/ziglang/zig/issues/17178 explored storing these bit offsets
+/// into the packed struct InternPool data rather than computing this on the
+/// fly, however it was found to perform worse when measured on real world
+/// projects.
pub fn structPackedFieldBitOffset(
mod: *Module,
struct_type: InternPool.Key.StructType,