aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/StatementGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 06:54:32 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 06:54:32 +0000
commit74b6d06711afd3efbbc47436f1491900994313f3 (patch)
treeb9050214b147cd2b1b54fd27e75d669bf6146e48 /lib/CodeGen/StatementGen.cc
parent39661855c0816ac248be437704c76f58359cb5f0 (diff)
feat(classes): allocate objects with NEW and rebind named class variables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/StatementGen.cc')
-rw-r--r--lib/CodeGen/StatementGen.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/CodeGen/StatementGen.cc b/lib/CodeGen/StatementGen.cc
index 2443877..bd1f7c5 100644
--- a/lib/CodeGen/StatementGen.cc
+++ b/lib/CodeGen/StatementGen.cc
@@ -128,10 +128,7 @@ void CodeGen::emitStmt(StmtAST *Stmt) {
return;
}
- Value *Val = emitCoercedExpr(Assign->getExpr(), resolveType(Info->TypeName));
- if (!Val) return;
-
- Builder->CreateStore(Val, Info->Storage);
+ emitAssignment({symbolAddress(*Info), Info->TypeName}, Assign->getExpr(), Info);
return;
}
@@ -296,9 +293,7 @@ void CodeGen::emitStmt(StmtAST *Stmt) {
if (auto *DA = dynamic_cast<DesignatorAssignStmtAST*>(Stmt)) {
LValueInfo LV;
if (!emitLValue(DA->getTarget(), LV)) return;
- Value *Val = emitCoercedExpr(DA->getExpr(), resolveType(LV.TypeName));
- if (!Val) return;
- Builder->CreateStore(Val, LV.Addr);
+ emitAssignment(LV, DA->getExpr());
return;
}
}