blaise/tests
Graeme Geldenhuys cf923852bd hand source: implement QBE sret convention for record-returning functions
Add the full structure-return (sret) convention to the hand source so
stage-2 generates correct IR for functions/methods that return tyRecord:

- EmitMethodDef/EmitFuncDef: declare record-returning functions as void
  with a hidden first param `l %_par__sret`; initialise %_var_Result
  from it; emit bare `ret` at exit.

- IsRecordCall / EmitRecordCallSret: detect record-returning call
  expressions (TFuncCallExpr, TMethodCallExpr, TFieldAccessExpr) and
  emit them with the sret address as the first argument.  Handles the
  IsImplicitSelf path with correct Self+offset pointer arithmetic.

- EmitRecordCopy / EmitRecordReleaseFields: field-by-field ARC-correct
  copy and release helpers for record types.

- EmitAssignment tyRecord branch: for record-typed lhs, either call
  EmitRecordCallSret (when the rhs is a call) or EmitRecordCopy.

- ImplicitSelfField tyRecord branch in EmitAssignment: same logic for
  assignments to record fields reached via implicit Self.

- TIdentExpr IsImplicitSelf tyRecord fix: return the field address
  rather than loading through it (callers need the address for copies).

- TIdentExpr local/global record variable fix: return VarRef address
  directly instead of an extra loadl.

All fixes mirror what the real multi-file source already had; this
brings the hand source to parity for record-return code generation.
2026-04-25 19:44:30 +01:00
..
integration Add Phase 2: record/class types, ARC strings, RTL stubs, and grammar doc 2026-04-20 19:04:12 +01:00
blaise-compiler.pas hand source: implement QBE sret convention for record-returning functions 2026-04-25 19:44:30 +01:00
phase2_milestone.pas Collapse Write+WriteLn pairs into multi-arg WriteLn in milestone tests 2026-04-22 23:19:55 +01:00
phase3_milestone.pas Add TObjectList and TStringList to RTL; fix string ARC via typed pointers 2026-04-23 12:32:59 +01:00