aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ConstructorGen.cc
AgeCommit message (Collapse)Author
2026-10-30refactor(strings): construct string values implicitly from raw literals_ov4
Keep double-quoted literals and text constants as C_STRING values. Use marked STRING constructors for text and CHAR conversion, preserving string operations and I/O through the existing class machinery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30feat(types): support implicit single-argument constructors_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27feat(library)!: replace #LIB with __LIB source regions_ov4
Track library mode by original source line, including deferred template bodies and automatic object cleanup. Update call lines from ordinary code and migrate the embedded standard library to PP_DEFINE __LIB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27refactor(memory)!: move allocation functions into memory.cps_ov4
Route keyword NEW and DELETE through the same library runtime and retain allocation tracking, runtime diagnostics and exception behavior. BREAKING CHANGE: -no-std programs using NEW or DELETE must explicitly import memory.cps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24feat(overload): select overloads by return type as well as parameters_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22feat(codegen): convert implicitly between CHAR and STRING_ov4
A CHAR becomes a one-character STRING in &, comparisons, assignment, parameter passing and RETURN. A STRING becomes a CHAR in assignment, parameter passing and RETURN, with a runtime error when its length is not 1. CHAR with INTEGER or BOOLEAN still does not convert. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22fix(classes): defer NEW for DECLARE without a parameterless constructor_ov4
A plain DECLARE, field or array element now calls NEW only when the class has a parameterless one; otherwise the zeroed object waits for x <- NEW C(...), as in guide section 10.2. DECLARE with parentheses still requires a matching constructor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22fix(arrays): free array buffers when their scope ends_ov4
Register every array as a stack object so its buffer is freed on scope end, re-DECLARE, RETURN and unwinding; run the element-destroy loop only for types that need destruction. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22refactor(codegen): share record field default construction_ov4
copyClassValue, emitConstruct and emitStringFromCString each walked the record fields and default-constructed those that need it. Move the loop into a private emitFieldDefaults helper; each caller passes the same line as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22refactor(codegen): remove dead parameters, fields and branches_ov4
Drop the never-read StackObject::IsCopy flag and registerStackObject parameter, the unused NewExprAST forward declaration, the unused Ret parameter of FunctionGen::emitReturn and CG parameter of ArrayHandler::loadElement, unused <cstdio> includes, and the coerceValueToType early returns already covered by the exact LLVM type check (builtin kinds always map to double/i64/i1/i8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20fix(strings): preserve enclosing class lifetimes during assignment_ov4
Copy owned string fields without reconstructing or destroying their containing class, and retain rvalue ownership transfers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20refactor(strings): replace compiler builtins with the STRING library_ov4
Construct literals as STRING values and route string operations through ordinary library functions and operators. Preserve value ownership in records, arrays, constants and file I/O. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(operators): allow member assignment operator overloads_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18feat(classes): add copy constructors and statement-scoped temporaries_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17feat(classes): destroy stack objects during exception unwinding_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17feat(classes): destroy stack objects at scope exit_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17feat(classes): destroy and release heap objects with DELETE_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17fix(classes): preserve method-only heap objects and document NEW_ov4
Allocate at least one byte for method-only classes so their heap addresses remain usable through pointers. Complete constructor diagnostics, field-order and exception coverage, document construction and rebinding, and highlight NEW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17feat(classes): allocate objects with NEW and rebind named class variables_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17feat(classes): construct declared objects and nested fields and arrays_ov4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>