ssa: global use elem type

This commit is contained in:
visualfc
2024-06-14 09:57:23 +08:00
parent 0c321c8c98
commit ec1cca7ca4
83 changed files with 407 additions and 412 deletions

View File

@@ -217,7 +217,7 @@ func (p Package) PyNewModVar(name string, doInit bool) Global {
objPtr := prog.PyObjectPtrPtr().raw.Type
g := p.NewVar(name, objPtr, InC)
if doInit {
g.Init(prog.Nil(g.Type))
g.InitNil()
g.impl.SetLinkage(llvm.LinkOnceAnyLinkage)
}
p.pymods[name] = g
@@ -372,7 +372,7 @@ func (p Package) PyNewFunc(name string, sig *types.Signature, doInit bool) PyObj
obj := p.NewVar(name, prog.PyObjectPtrPtr().RawType(), InC)
if doInit {
prog.NeedPyInit = true
obj.Init(prog.Nil(obj.Type))
obj.InitNil()
obj.impl.SetLinkage(llvm.LinkOnceAnyLinkage)
}
ty := &aType{obj.ll, rawType{types.NewPointer(sig)}, vkPyFuncRef}