cl: callRuntimeInit; runtime: TracePanic
This commit is contained in:
@@ -231,8 +231,9 @@ func (p *context) compileBlock(b llssa.Builder, block *ssa.BasicBlock, doInit bo
|
||||
ret := p.fn.Block(block.Index)
|
||||
b.SetBlock(ret)
|
||||
if doInit {
|
||||
fn := p.pkg.FuncOf("main.init")
|
||||
b.Call(fn.Expr)
|
||||
pkg := p.pkg
|
||||
callRuntimeInit(b, pkg)
|
||||
b.Call(pkg.FuncOf("main.init").Expr)
|
||||
}
|
||||
for _, instr := range block.Instrs {
|
||||
p.compileInstr(b, instr)
|
||||
@@ -240,6 +241,15 @@ func (p *context) compileBlock(b llssa.Builder, block *ssa.BasicBlock, doInit bo
|
||||
return ret
|
||||
}
|
||||
|
||||
const (
|
||||
RuntimeInit = llssa.PkgRuntime + ".init"
|
||||
)
|
||||
|
||||
func callRuntimeInit(b llssa.Builder, pkg llssa.Package) {
|
||||
fn := pkg.NewFunc(RuntimeInit, types.NewSignatureType(nil, nil, nil, nil, nil, false))
|
||||
b.Call(fn.Expr)
|
||||
}
|
||||
|
||||
func isAny(t types.Type) bool {
|
||||
if t, ok := t.(*types.Interface); ok {
|
||||
return t.Empty()
|
||||
|
||||
Reference in New Issue
Block a user