ssa: support runtime.map

This commit is contained in:
visualfc
2024-06-28 22:01:58 +08:00
parent e05e61a59b
commit 2ccd1625e7
15 changed files with 1391 additions and 102 deletions

View File

@@ -1005,6 +1005,8 @@ func (b Builder) BuiltinCall(fn string, args ...Expr) (ret Expr) {
return b.StringLen(arg)
case vkChan:
return b.InlineCall(b.Pkg.rtFunc("ChanLen"), arg)
case vkMap:
return b.MapLen(arg)
}
}
case "cap":
@@ -1131,6 +1133,9 @@ func (b Builder) PrintEx(ln bool, args ...Expr) (ret Expr) {
case vkChan:
fn = "PrintPointer"
typ = prog.VoidPtr()
case vkMap:
fn = "PrintPointer"
typ = prog.VoidPtr()
default:
panic(fmt.Errorf("illegal types for operand: print %v", arg.RawType()))
}