fix types named recursive

This commit is contained in:
visualfc
2024-05-11 12:03:02 +08:00
parent 2589c23998
commit 92827a1f04
5 changed files with 201 additions and 6 deletions

View File

@@ -106,6 +106,7 @@ type aProgram struct {
target *Target
td llvm.TargetData
// tm llvm.TargetMachine
named map[string]llvm.Type
intType llvm.Type
int1Type llvm.Type
@@ -154,7 +155,7 @@ func NewProgram(target *Target) Program {
// TODO(xsw): Finalize may cause panic, so comment it.
ctx.Finalize()
*/
return &aProgram{ctx: ctx, gocvt: newGoTypes(), target: target, td: td}
return &aProgram{ctx: ctx, gocvt: newGoTypes(), target: target, td: td, named: make(map[string]llvm.Type)}
}
// SetRuntime sets the runtime.