llgo/ssa: Alloc, BinOp(vkPtr)

This commit is contained in:
xushiwei
2024-04-28 07:08:01 +08:00
parent 475f0fa2ff
commit 5415f68c1b
4 changed files with 32 additions and 12 deletions

View File

@@ -113,11 +113,12 @@ type aProgram struct {
rtIfaceTy llvm.Type
rtSliceTy llvm.Type
anyTy Type
voidTy Type
boolTy Type
intTy Type
f64Ty Type
anyTy Type
voidTy Type
boolTy Type
uintptrTy Type
intTy Type
f64Ty Type
}
// A Program presents a program.
@@ -211,6 +212,14 @@ func (p Program) Int() Type {
return p.intTy
}
// Uintptr returns uintptr type.
func (p Program) Uintptr() Type {
if p.uintptrTy == nil {
p.uintptrTy = p.Type(types.Typ[types.Uintptr])
}
return p.uintptrTy
}
// Float64 returns float64 type.
func (p Program) Float64() Type {
if p.f64Ty == nil {