This commit is contained in:
xushiwei
2024-04-17 00:01:42 +08:00
parent 70ec2350eb
commit 2596f1d5b2
4 changed files with 29 additions and 1 deletions

View File

@@ -38,6 +38,15 @@ func (p *Program) llvmType(typ types.Type) llvm.Type {
return ret
}
func (p *Program) llvmSignature(sig *types.Signature) llvm.Type {
if v := p.typs.At(sig); v != nil {
return v.(llvm.Type)
}
ret := p.toLLVMFunc(sig)
p.typs.Set(sig, ret)
return ret
}
func (p *Program) tyVoidPtr() llvm.Type {
if p.voidPtrTy.IsNil() {
p.voidPtrTy = llvm.PointerType(p.tyVoid(), 0)