fibers: rename ABI variant .pure -> .naked

"pure" universally means side-effect-free (GCC __attribute__((pure)),
FP purity, D's pure) — the opposite of a register-clobbering context
switch. The concept is "naked": no compiler-generated prologue/epilogue,
body is raw asm that emits its own ret. That is the established term
everywhere (LLVM's naked function attribute — which we literally emit —
plus Zig callconv(.naked), Rust #[naked], GCC/Clang __attribute__
((naked))). Rename the keyword + everything keyed off it so concept,
surface, field, and the emitted LLVM attribute all agree.

- ast.zig: ABI enum variant pure -> naked (+ doc).
- parser: accept abi(.naked); error text updated.
- IR Function.is_pure -> is_naked; type_resolver/decl/generic/pack/
  emit_llvm references updated; diagnostics say abi(.naked).
- examples 1800-1803 renamed *-pure-* -> *-naked-* (source + expected/
  snapshots; .ir/.exit/.stdout/.stderr are byte-identical — the emitted
  IR is unchanged, only the keyword spelling differs).
- docs (PLAN-FIBERS, CHECKPOINT-FIBERS, PLAN-POST-METATYPE, the design
  roadmap, the compiler-API checkpoint/design) updated; the naming
  rationale now records why .naked over .pure.

No semantic change — pure cosmetics. Suite green (725/0).
This commit is contained in:
agra
2026-06-20 17:01:09 +03:00
parent b631590574
commit a7fe165684
40 changed files with 175 additions and 171 deletions

View File

@@ -137,9 +137,10 @@ pub const Root = struct {
/// bodiless decls whose Zig/VM handler is the impl) AND user compiler-domain
/// functions like post-link callbacks (bodied, but emit-skipped). The ABI alone
/// marks it — there is no `extern <lib>` and no fake `#library "compiler"`.
/// - `.pure` — a pure / naked function (inline asm body), no calling-convention
/// prologue/epilogue.
pub const ABI = enum { default, c, compiler, pure };
/// - `.naked` — a naked function (inline asm body), no calling-convention
/// prologue/epilogue. The body is responsible for its own `ret`; args arrive
/// in ABI registers (no frame, no implicit `__sx_ctx`).
pub const ABI = enum { default, c, compiler, naked };
/// Linkage modifier written in the postfix slot before `abi(...)`:
/// `name :: (sig) -> Ret [extern | export] [abi(.x)] [lib] [;|{…}];`
@@ -156,7 +157,7 @@ pub const FnDecl = struct {
body: *Node,
type_params: []const StructTypeParam = &.{},
is_arrow: bool = false,
/// ABI / calling-convention annotation (`abi(.c)` / `abi(.zig)` / `abi(.pure)`)
/// ABI / calling-convention annotation (`abi(.c)` / `abi(.zig)` / `abi(.naked)`)
/// in the postfix slot after `extern`/`export`. `.default` = unannotated.
/// `.zig` marks a function bound to the comptime `compiler` library — its
/// signature is welded to the real internal Zig fn and it dispatches over the