prog.PointerSize

This commit is contained in:
xushiwei
2024-05-28 17:55:26 +08:00
parent 585bdb549f
commit 8c2946a41b
2 changed files with 4 additions and 2 deletions

View File

@@ -165,6 +165,8 @@ type aProgram struct {
paramObjPtr_ *types.Var
ptrSize int
NeedRuntime bool
NeedPyInit bool
is32Bits bool
@@ -194,7 +196,7 @@ func NewProgram(target *Target) Program {
return &aProgram{
ctx: ctx, gocvt: newGoTypes(),
target: target, td: td, is32Bits: is32Bits,
named: make(map[string]llvm.Type),
ptrSize: td.PointerSize(), named: make(map[string]llvm.Type),
}
}

View File

@@ -178,7 +178,7 @@ func OffsetOf(prog Program, t Type, i int) Expr {
*/
func (p Program) PointerSize() int {
return p.td.PointerSize()
return p.ptrSize
}
func (p Program) Slice(typ Type) Type {