diff --git a/cl/compile.go b/cl/compile.go index 1dd4f1b0..ed9924d2 100644 --- a/cl/compile.go +++ b/cl/compile.go @@ -730,26 +730,21 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) { // Not a local variable. return } + if v.IsAddr { + // skip *ssa.Alloc or *ssa.FieldAddr + return + } pos := p.goProg.Fset.Position(v.Pos()) value := p.compileValue(b, v.X) fn := v.Parent() dbgVar := p.getLocalVariable(b, fn, variable) - if v.IsAddr { - // *ssa.Alloc or *ssa.FieldAddr - b.DIDeclare(value, dbgVar, p.fn, pos, b.Func.Block(v.Block().Index)) - } else { - b.DIValue(value, dbgVar, p.fn, pos, b.Func.Block(v.Block().Index)) - } + b.DIValue(value, dbgVar, p.fn, pos, b.Func.Block(v.Block().Index)) } default: panic(fmt.Sprintf("compileInstr: unknown instr - %T\n", instr)) } } -type poser interface { - Pos() token.Pos -} - func (p *context) getLocalVariable(b llssa.Builder, fn *ssa.Function, v *types.Var) llssa.DIVar { pos := p.fset.Position(v.Pos()) t := b.Prog.Type(v.Type(), llssa.InGo)