ssa: fix function and global var debug info scope

This commit is contained in:
Li Jie
2024-09-20 12:22:08 +08:00
parent d89b68a279
commit f71e34fd9f
6 changed files with 38 additions and 10 deletions

View File

@@ -56,6 +56,10 @@ type aCompilationUnit struct {
type CompilationUnit = *aCompilationUnit
func (c CompilationUnit) scopeMeta(b diBuilder, pos token.Position) DIScopeMeta {
return &aDIScopeMeta{c.ll}
}
var DWARF_LANG_C llvm.DwarfLang = 0x2
var DWARF_LANG_GO llvm.DwarfLang = 0x16
@@ -576,7 +580,7 @@ func (b Builder) DIGlobal(v Expr, name string, pos token.Position) {
return
}
gv := b.di().createGlobalVariableExpression(
b.di().file(pos.Filename),
b.Pkg.cu,
pos,
name,
name,