Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MapInitToVar map[*ir.Func]*ir.Name
MapInitToVar is the inverse of VarToMapInit; it maintains a mapping from a compiler-generated init function to the map the function is initializing.
Functions ¶
func AddKeepRelocations ¶
func AddKeepRelocations()
AddKeepRelocations adds a dummy "R_KEEP" relocation from each global map variable V to its associated outlined init function. These relocation ensure that if the map var itself is determined to be reachable at link time, we also mark the init function as reachable.
func AnySideEffects ¶
AnySideEffects reports whether n contains any operations that could have observable side effects.
func OutlineMapInits ¶
OutlineMapInits walks through a list of init statements (candidates for inclusion in the package "init" function) and returns an updated list in which items corresponding to map variable initializations have been replaced with calls to outline "map init" functions (if legal/profitable). Return value is an updated list and a list of any newly generated "map init" functions.
Types ¶
type Schedule ¶
type Schedule struct { // Out is the ordered list of dynamic initialization // statements. Out []ir.Node Plans map[ir.Node]*Plan Temps map[ir.Node]*ir.Name }
An Schedule is used to decompose assignment statements into static and dynamic initialization parts. Static initializations are handled by populating variables' linker symbol data, while dynamic initializations are accumulated to be executed in order.
func (*Schedule) StaticAssign ¶
func (*Schedule) StaticInit ¶
StaticInit adds an initialization statement n to the schedule.