Skip to content

ssa: extend inherited native storage to layout and cache metadata - #3047

Closed
cpunion wants to merge 4 commits into
xgo-dev:mainfrom
cpunion:fix/2927-native-representation-complete
Closed

cpunion wants to merge 4 commits into
xgo-dev:mainfrom
cpunion:fix/2927-native-representation-complete

Conversation

@cpunion

@cpunion cpunion commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Preserve native storage through definitions such as:

type Copy Native
p := (*Copy)(&frame.Value)
p.Tail = 99 // updates Value.Tail without corrupting the sentinel

Extend #2931's provenance foundation (original authored commit retained) with aggregate source layouts, LLVM-based reflected offsets/pointer prefixes, compatible typed-pointer/callback ABI checks, and versioned package representation metadata. Cover private origins, aliases, generic instances, HostLayout, SIMD storage, and memory32 native slots. Native arrays keep backing storage and indexed element slots consistent. Ordinary Go functions retain their calling convention.

Draft for the remaining #2927 migration: owner-aware source queries for native overrides, function-field address escapes, automatic array repacking between different layouts, and callback reflection/FFI still need work; see doc/design/native-representation.md. This does not close #2872 or all cases in #2873.

Validation: official Go, native LLGo O0/O3 full-LTO, and W32/J32/J64 execution pass. Full SSA/ABI/frontcache, CL -short, and internal/build -short (855s) suites pass with matching LLVM 22, plus target-layout, race, and cold/hot/cross-process cache checks.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

@cpunion cpunion closed this Nov 10, 2026
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.

reflect: FFI type descriptions do not preserve cdecl/native layouts

2 participants