for i, n := range l {
f := structfield(n)
f.Funarg = funarg
-
- // esc.go needs to find f given a PPARAM to add the tag.
- if n.Left != nil && n.Left.Class() == PPARAM {
- n.Left.Name.Param.Field = f
- }
if f.Broke() {
t.SetBroke(true)
}
for _, f := range fields {
f.Funarg = funarg
-
- // esc.go needs to find f given a PPARAM to add the tag.
- if asNode(f.Nname) != nil && asNode(f.Nname).Class() == PPARAM {
- asNode(f.Nname).Name.Param.Field = f
- }
}
t.SetFields(fields)
return t
}
}
- for _, ln := range fn.Func.Dcl {
- if ln.Op != ONAME {
- continue
- }
-
- switch ln.Esc & EscMask {
- case EscNone, // not touched by escflood
- EscReturn:
- if types.Haspointers(ln.Type) { // don't bother tagging for scalars
- if ln.Name.Param.Field.Note != uintptrEscapesTag {
- ln.Name.Param.Field.Note = mktag(int(ln.Esc))
- }
- }
-
- case EscHeap: // touched by escflood, moved to heap
- }
- }
-
- // Unnamed parameters are unused and therefore do not escape.
- // (Unnamed parameters are not in the Dcl list in the loop above
- // so we need to mark them separately.)
for _, fs := range types.RecvsParams {
for _, f := range fs(fn.Type).Fields().Slice() {
if !types.Haspointers(f.Type) { // don't bother tagging for scalars
// Note is already set in the loop above.
continue
}
+
+ // Unnamed parameters are unused and therefore do not escape.
if f.Sym == nil || f.Sym.IsBlank() {
f.Note = mktag(EscNone)
+ continue
+ }
+
+ switch esc := asNode(f.Nname).Esc; esc & EscMask {
+ case EscNone, // not touched by escflood
+ EscReturn:
+ f.Note = mktag(int(esc))
+
+ case EscHeap: // touched by escflood, moved to heap
}
}
}