ssa: add debug info of function return type

This commit is contained in:
Li Jie
2024-09-22 17:43:31 +08:00
parent 70e271959b
commit c6bb4a23ae
3 changed files with 31 additions and 6 deletions

View File

@@ -329,9 +329,12 @@ func (p Function) SetRecover(blk BasicBlock) {
func (p Function) scopeMeta(b diBuilder, pos token.Position) DIScopeMeta {
if p.diFunc == nil {
paramTypes := make([]llvm.Metadata, len(p.params))
sig := p.Type.raw.Type.(*types.Signature)
rt := p.Prog.Type(sig.Results(), InGo)
paramTypes := make([]llvm.Metadata, len(p.params)+1)
paramTypes[0] = b.diType(rt, pos).ll
for i, t := range p.params {
paramTypes[i] = b.diType(t, pos).ll
paramTypes[i+1] = b.diType(t, pos).ll
}
diFuncType := b.di.CreateSubroutineType(llvm.DISubroutineType{
File: b.file(pos.Filename).ll,