github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/ir/scc.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ir 6 7 // VisitFuncsBottomUp invokes analyze on the ODCLFUNC nodes listed in list. 8 // It calls analyze with successive groups of functions, working from 9 // the bottom of the call graph upward. Each time analyze is called with 10 // a list of functions, every function on that list only calls other functions 11 // on the list or functions that have been passed in previous invocations of 12 // analyze. Closures appear in the same list as their outer functions. 13 // The lists are as short as possible while preserving those requirements. 14 // (In a typical program, many invocations of analyze will be passed just 15 // a single function.) The boolean argument 'recursive' passed to analyze 16 // specifies whether the functions on the list are mutually recursive. 17 // If recursive is false, the list consists of only a single function and its closures. 18 // If recursive is true, the list may still contain only a single function, 19 // if that function is itself recursive. 20 func VisitFuncsBottomUp(list []*Func, analyze func(list []*Func, recursive bool))