abi.Name; runtime: MakeAnyInt => MakeAnyIntptr; llgo/ssa: AllocU; builtin unsafe.String; MakeInterface; prog.PointerSize

This commit is contained in:
xushiwei
2024-05-20 08:46:39 +08:00
parent a6b8edde62
commit e61ebb4eb9
13 changed files with 342 additions and 63 deletions

View File

@@ -99,6 +99,7 @@ type aProgram struct {
ctx llvm.Context
typs typeutil.Map // rawType -> Type
gocvt goTypes
//abi *abi.Builder
rt *types.Package
rtget func() *types.Package
@@ -158,6 +159,7 @@ type aProgram struct {
NeedRuntime bool
NeedPyInit bool
is32Bits bool
}
// A Program presents a program.
@@ -180,7 +182,12 @@ func NewProgram(target *Target) Program {
// TODO(xsw): Finalize may cause panic, so comment it.
ctx.Finalize()
*/
return &aProgram{ctx: ctx, gocvt: newGoTypes(), target: target, td: td, named: make(map[string]llvm.Type)}
is32Bits := (td.PointerSize() == 4)
return &aProgram{
ctx: ctx, gocvt: newGoTypes(), // abi: abi.New(),
target: target, td: td, is32Bits: is32Bits,
named: make(map[string]llvm.Type),
}
}
// SetPython sets the Python package.