spl 编写编译器基础框架 ai修复出现的stage2和stage3问题并提供新语法

This commit is contained in:
zzy committed 2026-11-07 21:52:02 +08:00
1 parent 126b979f72
commit 50ee126d44
87 files changed
+3168 -394

No files matched your search

+8
View File
@@ -1856,6 +1856,14 @@ fn emit_match(self: *Hir2Ir, ref: usize): usize {
}
var ov = emit_expr(self, x.operand);
var ol = SemaM.tid_of(self.sema, x.operand);
// 聚合 call 结果可能只在该 sret 槽有效;先复制到 match 自己的稳定槽,
// 避免后续分支/局部写入覆盖操作数。
if LangType.is_agg(&self.sema.types, ol) {
var oir = SemaM.ir_of(self.sema, ol);
var stable = IrBuilder.mem_alloca(self.b, oir, const_usize(self, 1));
ignore_usize(IrBuilder.mem_store(self.b, oir, stable, ov));
ov = stable;
}
var jmps = Vec.blank(@sizeof(usize), @alignof(usize));
var i: usize = 0;
while i < x.arms.len {