compiler: make package exports self-contained

This commit is contained in:
2026-08-12 01:12:42 +09:00
parent 52f6d6f0d4
commit 9b970eb16a
10 changed files with 965 additions and 82 deletions

View File

@@ -4012,6 +4012,14 @@ fn ffiresolve(c: *cgen, ident: str) str = {
return ident;
};
// The compiler intrinsic `alloc` has a package-mode runtime ABI independent
// of whichever transitive interfaces happen to be present. Raw w6c remains
// declaration-driven so existing @symbol/FFI behavior is unchanged.
fn allocresolve(c: *cgen) str = {
if (c.sepmode != 0) { return "rt_malloc"; };
return ffiresolve(c, "malloc");
};
fn argregname(i: i32) str = {
if (i == 0) { return "DI"; };
if (i == 1) { return "SI"; };