cmd/compile: remove Type.Vargen #19878
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
The only place that Type.Vargen is written is in typechecking, where is it set with
t.Vargen = n.Name.Vargen
. A few lines later, we also provide t with a reference to n:t.Nod = asTypesNode(n)
. So Type.Vargen could be implemented as a lazy lookup of t.Nod.Name.Vargen, defaulting to zero if t.Nod or t.Nod.Name are nil.I'd send a CL, but amusingly, yesterday's refactoring made it more difficult, because Nod fields are now inaccessible from Types. If we switch to using (say) an interface for Type.Nod, then the Node Vargen lookup could become part of that interface. Conveniently, removing Type.Vargen would almost pay for that, size-wise.
cc @mdempsky @griesemer
The text was updated successfully, but these errors were encountered: