Skip to content

feat(types): named structure member layout - #69

Merged
rieske merged 4 commits into
masterfrom
feature/structs-member-access
Jul 24, 2026
Merged

feat(types): named structure member layout#69
rieske merged 4 commits into
masterfrom
feature/structs-member-access

Conversation

@rieske

@rieske rieske commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • type::structure({{name, type}, …}) with memberOffset / memberType and layout size.
  • Layout uses natural alignment + trailing pad (SysV-style stand-in).
  • Rejects incomplete/duplicate members and oversized layouts; peels pointer-to-struct.
  • Unit tests for two-int layout, mixed members, trailing pad / array stride, factory guards.

Not yet

grammar/CSNB for struct S { … }, . / -> member access, or field IR (FieldAddress).

Stack

PR 6/6 foundation — base is master (arrays/sizeof #68 merged).

Test plan

  • Full local ctest
  • Type structure unit tests
  • CI green

@mergify

mergify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@rieske
rieske force-pushed the feature/recursive-type-sizeof branch from df5b3ef to fa34efb Compare July 24, 2026 07:12
@rieske
rieske force-pushed the feature/structs-member-access branch from 87b04f9 to 1ecfde4 Compare July 24, 2026 07:12
@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 92.526% (-0.1%) from 92.637% — feature/structs-member-access into master

@rieske
rieske force-pushed the feature/recursive-type-sizeof branch from fa34efb to adb305e Compare July 24, 2026 07:18
@rieske
rieske force-pushed the feature/structs-member-access branch from 1ecfde4 to a136a33 Compare July 24, 2026 07:18
@rieske
rieske force-pushed the feature/recursive-type-sizeof branch from adb305e to c27b7a9 Compare July 24, 2026 07:27
@rieske
rieske force-pushed the feature/structs-member-access branch from a136a33 to 5a4ad47 Compare July 24, 2026 07:27
@rieske
rieske force-pushed the feature/recursive-type-sizeof branch from c27b7a9 to b9f786c Compare July 24, 2026 07:34
@rieske
rieske force-pushed the feature/structs-member-access branch from 5a4ad47 to 7103848 Compare July 24, 2026 07:34
@rieske rieske mentioned this pull request Jul 24, 2026
3 tasks
@rieske
rieske force-pushed the feature/structs-member-access branch 3 times, most recently from a8811c0 to f1b8b2f Compare July 24, 2026 08:24
Base automatically changed from feature/recursive-type-sizeof to master July 24, 2026 08:36
rieske added 4 commits July 24, 2026 11:36
Introduce structure types with named members, sequential offsets, and
size. Unit-tested via Type.structureMembersHaveOffsetsAndSize. Full
language surface (struct definitions in CSNB, member access codegen)
remains the next transplant from finish-for-git.
Use natural alignment and trailing pad for structure members, treat
pointer-to-structure as pointer-only, and strengthen structure Type tests.
Reject incomplete and duplicate members, accumulate layout size in
long long with overflow checks, and cover trailing pad / array stride.
@rieske
rieske force-pushed the feature/structs-member-access branch from f1b8b2f to 09e9abc Compare July 24, 2026 08:36
@rieske
rieske merged commit 537b3ad into master Jul 24, 2026
3 of 5 checks passed
@rieske
rieske deleted the feature/structs-member-access branch July 24, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants