From 5fdea7e2edd534d15eff95efb33336430d7b4872 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 03:49:08 +0000 Subject: refactor(codegen): share record field default construction 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 --- include/cps/CodeGen.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/cps/CodeGen.h') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 2d77284..7085560 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -90,6 +90,7 @@ class CodeGen { bool emitConstruct(const std::string &TypeName, llvm::Value *Addr, const std::vector> &Args, int Line); bool emitDefaultConstruct(const std::string &TypeName, llvm::Value *Addr, int Line); + bool emitFieldDefaults(const TypeInfo *Type, llvm::Value *Addr, int Line); struct StackObject { llvm::Value *Addr; std::string TypeName; -- cgit v1.3.1-4-g156e