aboutsummaryrefslogtreecommitdiff
path: root/include/cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 03:49:08 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 03:58:26 +0000
commit5fdea7e2edd534d15eff95efb33336430d7b4872 (patch)
treeb5528d64124a8b9b299c10c9452e58d2cfbfcd6a /include/cps
parent1d2bb133b7a3540aeb81c5f9616cb366aebc919f (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'include/cps')
-rw-r--r--include/cps/CodeGen.h1
1 files changed, 1 insertions, 0 deletions
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<std::unique_ptr<ExprAST>> &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;