TestEmptyStruct

This commit is contained in:
xushiwei
2024-04-16 03:05:20 +08:00
parent 88cd652c43
commit 4a1cb350b1
3 changed files with 113 additions and 9 deletions

View File

@@ -38,6 +38,8 @@ type Program struct {
int16Type llvm.Type
int32Type llvm.Type
int64Type llvm.Type
voidType llvm.Type
voidPtrTy llvm.Type
}
func NewProgram(target *Target) *Program {
@@ -73,10 +75,6 @@ func (p *Package) NewConst(name string, val constant.Value) *NamedConst {
return &NamedConst{}
}
func (p *Package) NewType(name string, typ types.Type) *Type {
return &Type{}
}
func (p *Package) NewVar(name string, typ types.Type) *Global {
gbl := llvm.AddGlobal(p.mod, p.prog.llvmType(typ), name)
return &Global{gbl}