// DevirtualizeAndInlinePackage interleaves devirtualization and inlining on // all functions within pkg. func DevirtualizeAndInlinePackage(pkg *ir.Package, profile *pgoir.Profile) { … } // DevirtualizeAndInlineFunc interleaves devirtualization and inlining // on a single function. func DevirtualizeAndInlineFunc(fn *ir.Func, profile *pgoir.Profile) { … } // fixpoint repeatedly edits a function until it stabilizes. // // First, fixpoint applies match to every node n within fn. Then it // iteratively applies edit to each node satisfying match(n). // // If edit(n) returns nil, no change is made. Otherwise, the result // replaces n in fn's body, and fixpoint iterates at least once more. // // After an iteration where all edit calls return nil, fixpoint // returns. func fixpoint(fn *ir.Func, match func(ir.Node) bool, edit func(ir.Node) ir.Node) { … }