ssa: compile go string constant without alloca

This commit is contained in:
Li Jie
2024-11-24 15:19:16 +08:00
parent 17832fe18c
commit 43c1bc8d5f
73 changed files with 9742 additions and 21877 deletions

View File

@@ -234,7 +234,7 @@ func (b Builder) Const(v constant.Value, typ Type) Expr {
v, _ := constant.Float64Val(constant.ToFloat(v))
return prog.FloatVal(v, typ)
case kind == types.String:
return Expr{b.Str(constant.StringVal(v)).impl, typ}
return b.Str(constant.StringVal(v))
case kind == types.Complex128 || kind == types.Complex64:
v = constant.ToComplex(v)
re, _ := constant.Float64Val(constant.Real(v))