ssa: index take addr

This commit is contained in:
visualfc
2024-07-02 21:14:36 +08:00
parent 46423ed166
commit 28d8c56534
9 changed files with 466 additions and 91 deletions

View File

@@ -179,6 +179,10 @@ func (b Builder) buildVal(typ Type, val llvm.Value, lvl int) Expr {
telem := b.Prog.rawType(t.Field(0).Type())
elem := b.buildVal(telem, val, lvl-1)
return Expr{aggregateValue(b.impl, typ.ll, elem.impl), typ}
case *types.Array:
telem := b.Prog.rawType(t.Elem())
elem := b.buildVal(telem, val, lvl-1)
return Expr{llvm.ConstArray(typ.ll, []llvm.Value{elem.impl}), typ}
}
panic("todo")
}