ssa: debug info of global variable

This commit is contained in:
Li Jie
2024-09-18 22:05:41 +08:00
parent 90a83c8f11
commit 87f6c8087f
3 changed files with 28 additions and 2 deletions

View File

@@ -797,7 +797,12 @@ func (p *context) compileValue(b llssa.Builder, v ssa.Value) llssa.Expr {
}
return pyFn.Expr
case *ssa.Global:
return p.varOf(b, v)
val := p.varOf(b, v)
if debugSymbols {
pos := p.fset.Position(v.Pos())
b.DIGlobal(val, v.Name(), pos)
}
return val
case *ssa.Const:
t := types.Default(v.Type())
bg := llssa.InGo