This was noticed while testing hash-search debugging
of the loopvar experiment.
The change is incomplete -- it only addresses local
variables, not parameters. The code to log/search
changes in loop variable semantics depends on this,
so that will be the test.
Change-Id: I0f84ab7696c6cab43486242cacaba6a0bfc45475
Reviewed-on: https://go-review.googlesource.com/c/go/+/464315
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: David Chase <drchase@google.com>
name.SetInlFormal(true)
ctxt = ir.PAUTO
}
-
- // TODO(mdempsky): Rethink this hack.
- if strings.HasPrefix(name.Sym().Name, "~") || base.Flag.GenDwarfInl == 0 {
- name.SetPos(r.inlCall.Pos())
- name.SetInlFormal(false)
- name.SetInlLocal(false)
- }
}
name.Class = ctxt
name.Curfn = callerfn
callerfn.Dcl = append(callerfn.Dcl, name)
- // Quirkish. TODO(mdempsky): Document why.
if name.AutoTemp() {
name.SetEsc(ir.EscUnknown)
-
- if base.Flag.GenDwarfInl != 0 {
- name.SetInlLocal(true)
- } else {
- name.SetPos(r.inlCall.Pos())
- }
+ name.SetInlLocal(true)
}
}
}