pub enum AbiRet {
Gc,
GcUnit,
RawI64,
Ptr,
Void,
}Expand description
What a wrapper returns.
The Gc/GcUnit split is what relates a wrapper to its catalog row: “a
GcRef” alone says nothing about whether the reference can be Unit, so a
wrapper declared -> Gc that answers the Unit sentinel on a miss would hand
the program a value whose static type is V and whose runtime descriptor is
Unit.
There is deliberately no third arm. “May be Unit, may be a value” is the
defect, and its absence from this enum is what makes it unrepresentable. A
wrapper whose answer is sometimes absent says so in its result type —
Option[T] (§4.7) — or it faults.
Variants§
Gc
A GcRef carrying the wrapper’s answer: a value of the result type
its catalog row declares.
The Unit sentinel still comes back on a fault return — that is the ABI’s
universal “a Praxis function returns a valid GcRef even when it
unwinds” — and, in the handful of wrappers the codegen calls directly
(praxis_alloc_enum with a null schema, praxis_tuple_get with an
out-of-range index), on a refusal the compiler was responsible for
having prevented. Neither is “the value is absent”, which is the state
this arm rules out.
GcUnit
A GcRef that is always the Unit sentinel: the wrapper’s answer is
“done”, not a value. Vec.push, Map.insert, out, assert.
Not Void: the call still yields a GcRef the caller’s uniform value
channel consumes, and codegen treats it exactly as it treats Gc.
RawI64
A raw i64.
Ptr
A pointer-width raw word (a frame pointer, a function pointer).
Void
Nothing.